diff --git a/test/intrinsics/gen/abs/002533.wgsl b/test/intrinsics/gen/abs/002533.wgsl new file mode 100644 index 0000000000..26a968f86e --- /dev/null +++ b/test/intrinsics/gen/abs/002533.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_002533() { + var res: vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_002533(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_002533(); +} + +[[stage(compute)]] +fn compute_main() { + abs_002533(); +} diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl new file mode 100644 index 0000000000..63a8d671ea --- /dev/null +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_002533() { + float4 res = abs(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + abs_002533(); + return; +} + +void fragment_main() { + abs_002533(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_002533(); + return; +} + diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.msl b/test/intrinsics/gen/abs/002533.wgsl.expected.msl new file mode 100644 index 0000000000..15940e87b8 --- /dev/null +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_002533() { + float4 res = fabs(float4()); +} + +vertex void vertex_main() { + abs_002533(); + return; +} + +fragment void fragment_main() { + abs_002533(); + return; +} + +kernel void compute_main() { + abs_002533(); + return; +} + diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm new file mode 100644 index 0000000000..90cbf83ea4 --- /dev/null +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_002533 "abs_002533" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %abs_002533 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 FAbs %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %abs_002533 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %abs_002533 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %abs_002533 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl new file mode 100644 index 0000000000..480a9de6cb --- /dev/null +++ b/test/intrinsics/gen/abs/002533.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_002533() { + var res : vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_002533(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_002533(); +} + +[[stage(compute)]] +fn compute_main() { + abs_002533(); +} diff --git a/test/intrinsics/gen/abs/005174.wgsl b/test/intrinsics/gen/abs/005174.wgsl new file mode 100644 index 0000000000..7384a15183 --- /dev/null +++ b/test/intrinsics/gen/abs/005174.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_005174() { + var res: vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_005174(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_005174(); +} + +[[stage(compute)]] +fn compute_main() { + abs_005174(); +} diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl new file mode 100644 index 0000000000..2733aaeb75 --- /dev/null +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_005174() { + float3 res = abs(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + abs_005174(); + return; +} + +void fragment_main() { + abs_005174(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_005174(); + return; +} + diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.msl b/test/intrinsics/gen/abs/005174.wgsl.expected.msl new file mode 100644 index 0000000000..333bdcaaeb --- /dev/null +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_005174() { + float3 res = fabs(float3()); +} + +vertex void vertex_main() { + abs_005174(); + return; +} + +fragment void fragment_main() { + abs_005174(); + return; +} + +kernel void compute_main() { + abs_005174(); + return; +} + diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm new file mode 100644 index 0000000000..3c4c07511e --- /dev/null +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_005174 "abs_005174" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %abs_005174 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 FAbs %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %abs_005174 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %abs_005174 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %abs_005174 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl new file mode 100644 index 0000000000..0d0cb37c57 --- /dev/null +++ b/test/intrinsics/gen/abs/005174.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_005174() { + var res : vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_005174(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_005174(); +} + +[[stage(compute)]] +fn compute_main() { + abs_005174(); +} diff --git a/test/intrinsics/gen/abs/1ce782.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl new file mode 100644 index 0000000000..bc537633f7 --- /dev/null +++ b/test/intrinsics/gen/abs/1ce782.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_1ce782() { + var res: vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_1ce782(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_1ce782(); +} + +[[stage(compute)]] +fn compute_main() { + abs_1ce782(); +} diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl new file mode 100644 index 0000000000..dc858cbc2c --- /dev/null +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_1ce782() { + uint4 res = abs(uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + abs_1ce782(); + return; +} + +void fragment_main() { + abs_1ce782(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_1ce782(); + return; +} + diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl new file mode 100644 index 0000000000..5f35a135bb --- /dev/null +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_1ce782() { + uint4 res = abs(uint4()); +} + +vertex void vertex_main() { + abs_1ce782(); + return; +} + +fragment void fragment_main() { + abs_1ce782(); + return; +} + +kernel void compute_main() { + abs_1ce782(); + return; +} + diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm new file mode 100644 index 0000000000..d791e6213b --- /dev/null +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_1ce782 "abs_1ce782" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %13 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 + %abs_1ce782 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %13 + %9 = OpExtInst %v4uint %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_1ce782 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_1ce782 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_1ce782 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl new file mode 100644 index 0000000000..5bf8abe987 --- /dev/null +++ b/test/intrinsics/gen/abs/1ce782.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_1ce782() { + var res : vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_1ce782(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_1ce782(); +} + +[[stage(compute)]] +fn compute_main() { + abs_1ce782(); +} diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl new file mode 100644 index 0000000000..4ad1136ae6 --- /dev/null +++ b/test/intrinsics/gen/abs/1e9d53.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_1e9d53() { + var res: vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_1e9d53(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_1e9d53(); +} + +[[stage(compute)]] +fn compute_main() { + abs_1e9d53(); +} diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl new file mode 100644 index 0000000000..5c0e7012d1 --- /dev/null +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_1e9d53() { + float2 res = abs(float2(0.0f, 0.0f)); +} + +void vertex_main() { + abs_1e9d53(); + return; +} + +void fragment_main() { + abs_1e9d53(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_1e9d53(); + return; +} + diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl new file mode 100644 index 0000000000..f126e825e2 --- /dev/null +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_1e9d53() { + float2 res = fabs(float2()); +} + +vertex void vertex_main() { + abs_1e9d53(); + return; +} + +fragment void fragment_main() { + abs_1e9d53(); + return; +} + +kernel void compute_main() { + abs_1e9d53(); + return; +} + diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm new file mode 100644 index 0000000000..815fcf90de --- /dev/null +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_1e9d53 "abs_1e9d53" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %abs_1e9d53 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 FAbs %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %abs_1e9d53 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %abs_1e9d53 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %abs_1e9d53 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl new file mode 100644 index 0000000000..1e51a1f026 --- /dev/null +++ b/test/intrinsics/gen/abs/1e9d53.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_1e9d53() { + var res : vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_1e9d53(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_1e9d53(); +} + +[[stage(compute)]] +fn compute_main() { + abs_1e9d53(); +} diff --git a/test/intrinsics/gen/abs/467cd1.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl new file mode 100644 index 0000000000..422ee720c9 --- /dev/null +++ b/test/intrinsics/gen/abs/467cd1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_467cd1() { + var res: u32 = abs(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_467cd1(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_467cd1(); +} + +[[stage(compute)]] +fn compute_main() { + abs_467cd1(); +} diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl new file mode 100644 index 0000000000..0728dea0ca --- /dev/null +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_467cd1() { + uint res = abs(1u); +} + +void vertex_main() { + abs_467cd1(); + return; +} + +void fragment_main() { + abs_467cd1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_467cd1(); + return; +} + diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl new file mode 100644 index 0000000000..63d83b35f5 --- /dev/null +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_467cd1() { + uint res = abs(1u); +} + +vertex void vertex_main() { + abs_467cd1(); + return; +} + +fragment void fragment_main() { + abs_467cd1(); + return; +} + +kernel void compute_main() { + abs_467cd1(); + return; +} + diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm new file mode 100644 index 0000000000..7af5b05ece --- /dev/null +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_467cd1 "abs_467cd1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpConstantNull %uint + %float_1 = OpConstant %float 1 + %abs_467cd1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %15 + %9 = OpExtInst %uint %11 SAbs %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_467cd1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_467cd1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_467cd1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl new file mode 100644 index 0000000000..b40916d2f5 --- /dev/null +++ b/test/intrinsics/gen/abs/467cd1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_467cd1() { + var res : u32 = abs(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_467cd1(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_467cd1(); +} + +[[stage(compute)]] +fn compute_main() { + abs_467cd1(); +} diff --git a/test/intrinsics/gen/abs/4ad288.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl new file mode 100644 index 0000000000..0105439916 --- /dev/null +++ b/test/intrinsics/gen/abs/4ad288.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_4ad288() { + var res: i32 = abs(1); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_4ad288(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_4ad288(); +} + +[[stage(compute)]] +fn compute_main() { + abs_4ad288(); +} diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl new file mode 100644 index 0000000000..e7ff244109 --- /dev/null +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_4ad288() { + int res = abs(1); +} + +void vertex_main() { + abs_4ad288(); + return; +} + +void fragment_main() { + abs_4ad288(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_4ad288(); + return; +} + diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl new file mode 100644 index 0000000000..c454219341 --- /dev/null +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_4ad288() { + int res = abs(1); +} + +vertex void vertex_main() { + abs_4ad288(); + return; +} + +fragment void fragment_main() { + abs_4ad288(); + return; +} + +kernel void compute_main() { + abs_4ad288(); + return; +} + diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm new file mode 100644 index 0000000000..bb37f0715a --- /dev/null +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_4ad288 "abs_4ad288" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %15 = OpConstantNull %int + %float_1 = OpConstant %float 1 + %abs_4ad288 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %15 + %9 = OpExtInst %int %11 SAbs %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_4ad288 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_4ad288 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_4ad288 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl new file mode 100644 index 0000000000..2842caf0a3 --- /dev/null +++ b/test/intrinsics/gen/abs/4ad288.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_4ad288() { + var res : i32 = abs(1); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_4ad288(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_4ad288(); +} + +[[stage(compute)]] +fn compute_main() { + abs_4ad288(); +} diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl new file mode 100644 index 0000000000..5b305f88d8 --- /dev/null +++ b/test/intrinsics/gen/abs/5ad50a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_5ad50a() { + var res: vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_5ad50a(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_5ad50a(); +} + +[[stage(compute)]] +fn compute_main() { + abs_5ad50a(); +} diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl new file mode 100644 index 0000000000..075e3cfb50 --- /dev/null +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_5ad50a() { + int3 res = abs(int3(0, 0, 0)); +} + +void vertex_main() { + abs_5ad50a(); + return; +} + +void fragment_main() { + abs_5ad50a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_5ad50a(); + return; +} + diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl new file mode 100644 index 0000000000..2d542b82fa --- /dev/null +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_5ad50a() { + int3 res = abs(int3()); +} + +vertex void vertex_main() { + abs_5ad50a(); + return; +} + +fragment void fragment_main() { + abs_5ad50a(); + return; +} + +kernel void compute_main() { + abs_5ad50a(); + return; +} + diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm new file mode 100644 index 0000000000..3419005924 --- /dev/null +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_5ad50a "abs_5ad50a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %13 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 + %abs_5ad50a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %13 + %9 = OpExtInst %v3int %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_5ad50a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_5ad50a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_5ad50a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl new file mode 100644 index 0000000000..ec7efb6d2a --- /dev/null +++ b/test/intrinsics/gen/abs/5ad50a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_5ad50a() { + var res : vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_5ad50a(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_5ad50a(); +} + +[[stage(compute)]] +fn compute_main() { + abs_5ad50a(); +} diff --git a/test/intrinsics/gen/abs/7326de.wgsl b/test/intrinsics/gen/abs/7326de.wgsl new file mode 100644 index 0000000000..d32d55f3bb --- /dev/null +++ b/test/intrinsics/gen/abs/7326de.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_7326de() { + var res: vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7326de(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7326de(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7326de(); +} diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl new file mode 100644 index 0000000000..1452464479 --- /dev/null +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_7326de() { + uint3 res = abs(uint3(0u, 0u, 0u)); +} + +void vertex_main() { + abs_7326de(); + return; +} + +void fragment_main() { + abs_7326de(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_7326de(); + return; +} + diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.msl b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl new file mode 100644 index 0000000000..9c2eb81528 --- /dev/null +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_7326de() { + uint3 res = abs(uint3()); +} + +vertex void vertex_main() { + abs_7326de(); + return; +} + +fragment void fragment_main() { + abs_7326de(); + return; +} + +kernel void compute_main() { + abs_7326de(); + return; +} + diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm new file mode 100644 index 0000000000..55422b30f6 --- /dev/null +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_7326de "abs_7326de" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %13 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 + %abs_7326de = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %13 + %9 = OpExtInst %v3uint %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_7326de + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_7326de + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_7326de + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl new file mode 100644 index 0000000000..0cd0f3c8be --- /dev/null +++ b/test/intrinsics/gen/abs/7326de.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_7326de() { + var res : vec3 = abs(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7326de(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7326de(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7326de(); +} diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl new file mode 100644 index 0000000000..60f0174672 --- /dev/null +++ b/test/intrinsics/gen/abs/7f28e6.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_7f28e6() { + var res: vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7f28e6(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7f28e6(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7f28e6(); +} diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl new file mode 100644 index 0000000000..c2394dae6b --- /dev/null +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_7f28e6() { + uint2 res = abs(uint2(0u, 0u)); +} + +void vertex_main() { + abs_7f28e6(); + return; +} + +void fragment_main() { + abs_7f28e6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_7f28e6(); + return; +} + diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl new file mode 100644 index 0000000000..9ec60604ad --- /dev/null +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_7f28e6() { + uint2 res = abs(uint2()); +} + +vertex void vertex_main() { + abs_7f28e6(); + return; +} + +fragment void fragment_main() { + abs_7f28e6(); + return; +} + +kernel void compute_main() { + abs_7f28e6(); + return; +} + diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm new file mode 100644 index 0000000000..b3cffe166d --- /dev/null +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_7f28e6 "abs_7f28e6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %13 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 + %abs_7f28e6 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %13 + %9 = OpExtInst %v2uint %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_7f28e6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_7f28e6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_7f28e6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl new file mode 100644 index 0000000000..53a7554a8d --- /dev/null +++ b/test/intrinsics/gen/abs/7f28e6.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_7f28e6() { + var res : vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7f28e6(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7f28e6(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7f28e6(); +} diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl new file mode 100644 index 0000000000..c676477bf2 --- /dev/null +++ b/test/intrinsics/gen/abs/7faa9e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_7faa9e() { + var res: vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7faa9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7faa9e(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7faa9e(); +} diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl new file mode 100644 index 0000000000..80607a0913 --- /dev/null +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_7faa9e() { + int2 res = abs(int2(0, 0)); +} + +void vertex_main() { + abs_7faa9e(); + return; +} + +void fragment_main() { + abs_7faa9e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_7faa9e(); + return; +} + diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl new file mode 100644 index 0000000000..9b6091853a --- /dev/null +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_7faa9e() { + int2 res = abs(int2()); +} + +vertex void vertex_main() { + abs_7faa9e(); + return; +} + +fragment void fragment_main() { + abs_7faa9e(); + return; +} + +kernel void compute_main() { + abs_7faa9e(); + return; +} + diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm new file mode 100644 index 0000000000..76f9674acc --- /dev/null +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_7faa9e "abs_7faa9e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %13 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 + %abs_7faa9e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %13 + %9 = OpExtInst %v2int %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_7faa9e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_7faa9e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_7faa9e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl new file mode 100644 index 0000000000..c2f73f679b --- /dev/null +++ b/test/intrinsics/gen/abs/7faa9e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_7faa9e() { + var res : vec2 = abs(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_7faa9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_7faa9e(); +} + +[[stage(compute)]] +fn compute_main() { + abs_7faa9e(); +} diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl new file mode 100644 index 0000000000..05e66e2c27 --- /dev/null +++ b/test/intrinsics/gen/abs/9c80a6.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_9c80a6() { + var res: vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_9c80a6(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_9c80a6(); +} + +[[stage(compute)]] +fn compute_main() { + abs_9c80a6(); +} diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb08caba72 --- /dev/null +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_9c80a6() { + int4 res = abs(int4(0, 0, 0, 0)); +} + +void vertex_main() { + abs_9c80a6(); + return; +} + +void fragment_main() { + abs_9c80a6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_9c80a6(); + return; +} + diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl new file mode 100644 index 0000000000..26f8447172 --- /dev/null +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_9c80a6() { + int4 res = abs(int4()); +} + +vertex void vertex_main() { + abs_9c80a6(); + return; +} + +fragment void fragment_main() { + abs_9c80a6(); + return; +} + +kernel void compute_main() { + abs_9c80a6(); + return; +} + diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm new file mode 100644 index 0000000000..c3806cee25 --- /dev/null +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_9c80a6 "abs_9c80a6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %13 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 + %abs_9c80a6 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %13 + %9 = OpExtInst %v4int %12 SAbs %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %abs_9c80a6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_9c80a6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %abs_9c80a6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl new file mode 100644 index 0000000000..797774ca9a --- /dev/null +++ b/test/intrinsics/gen/abs/9c80a6.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_9c80a6() { + var res : vec4 = abs(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_9c80a6(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_9c80a6(); +} + +[[stage(compute)]] +fn compute_main() { + abs_9c80a6(); +} diff --git a/test/intrinsics/gen/abs/b96037.wgsl b/test/intrinsics/gen/abs/b96037.wgsl new file mode 100644 index 0000000000..cd0e4316ff --- /dev/null +++ b/test/intrinsics/gen/abs/b96037.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn abs_b96037() { + var res: f32 = abs(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_b96037(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_b96037(); +} + +[[stage(compute)]] +fn compute_main() { + abs_b96037(); +} diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl new file mode 100644 index 0000000000..655840a8e2 --- /dev/null +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void abs_b96037() { + float res = abs(1.0f); +} + +void vertex_main() { + abs_b96037(); + return; +} + +void fragment_main() { + abs_b96037(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + abs_b96037(); + return; +} + diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.msl b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl new file mode 100644 index 0000000000..f2db329957 --- /dev/null +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void abs_b96037() { + float res = fabs(1.0f); +} + +vertex void vertex_main() { + abs_b96037(); + return; +} + +fragment void fragment_main() { + abs_b96037(); + return; +} + +kernel void compute_main() { + abs_b96037(); + return; +} + diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm new file mode 100644 index 0000000000..af85239784 --- /dev/null +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %abs_b96037 "abs_b96037" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %abs_b96037 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 FAbs %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %abs_b96037 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %abs_b96037 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %abs_b96037 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl new file mode 100644 index 0000000000..112c0a18fa --- /dev/null +++ b/test/intrinsics/gen/abs/b96037.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn abs_b96037() { + var res : f32 = abs(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + abs_b96037(); +} + +[[stage(fragment)]] +fn fragment_main() { + abs_b96037(); +} + +[[stage(compute)]] +fn compute_main() { + abs_b96037(); +} diff --git a/test/intrinsics/gen/acos/489247.wgsl b/test/intrinsics/gen/acos/489247.wgsl new file mode 100644 index 0000000000..091f732b0d --- /dev/null +++ b/test/intrinsics/gen/acos/489247.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn acos_489247() { + var res: f32 = acos(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_489247(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_489247(); +} + +[[stage(compute)]] +fn compute_main() { + acos_489247(); +} diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl new file mode 100644 index 0000000000..f5c0610fb4 --- /dev/null +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void acos_489247() { + float res = acos(1.0f); +} + +void vertex_main() { + acos_489247(); + return; +} + +void fragment_main() { + acos_489247(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + acos_489247(); + return; +} + diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.msl b/test/intrinsics/gen/acos/489247.wgsl.expected.msl new file mode 100644 index 0000000000..1f9a49d762 --- /dev/null +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void acos_489247() { + float res = acos(1.0f); +} + +vertex void vertex_main() { + acos_489247(); + return; +} + +fragment void fragment_main() { + acos_489247(); + return; +} + +kernel void compute_main() { + acos_489247(); + return; +} + diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm new file mode 100644 index 0000000000..55b34321cf --- /dev/null +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %acos_489247 "acos_489247" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%acos_489247 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Acos %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %acos_489247 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %acos_489247 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %acos_489247 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl new file mode 100644 index 0000000000..4c8f3cc7aa --- /dev/null +++ b/test/intrinsics/gen/acos/489247.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn acos_489247() { + var res : f32 = acos(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_489247(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_489247(); +} + +[[stage(compute)]] +fn compute_main() { + acos_489247(); +} diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl new file mode 100644 index 0000000000..0c15ac2061 --- /dev/null +++ b/test/intrinsics/gen/acos/8e2acf.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn acos_8e2acf() { + var res: vec4 = acos(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_8e2acf(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_8e2acf(); +} + +[[stage(compute)]] +fn compute_main() { + acos_8e2acf(); +} diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl new file mode 100644 index 0000000000..df055b2eef --- /dev/null +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void acos_8e2acf() { + float4 res = acos(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + acos_8e2acf(); + return; +} + +void fragment_main() { + acos_8e2acf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + acos_8e2acf(); + return; +} + diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl new file mode 100644 index 0000000000..56875a7b1d --- /dev/null +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void acos_8e2acf() { + float4 res = acos(float4()); +} + +vertex void vertex_main() { + acos_8e2acf(); + return; +} + +fragment void fragment_main() { + acos_8e2acf(); + return; +} + +kernel void compute_main() { + acos_8e2acf(); + return; +} + diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm new file mode 100644 index 0000000000..0b7021c75a --- /dev/null +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %acos_8e2acf "acos_8e2acf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%acos_8e2acf = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Acos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %acos_8e2acf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %acos_8e2acf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %acos_8e2acf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl new file mode 100644 index 0000000000..8cce3c553b --- /dev/null +++ b/test/intrinsics/gen/acos/8e2acf.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn acos_8e2acf() { + var res : vec4 = acos(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_8e2acf(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_8e2acf(); +} + +[[stage(compute)]] +fn compute_main() { + acos_8e2acf(); +} diff --git a/test/intrinsics/gen/acos/a610c4.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl new file mode 100644 index 0000000000..d55e6bcd9e --- /dev/null +++ b/test/intrinsics/gen/acos/a610c4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn acos_a610c4() { + var res: vec3 = acos(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_a610c4(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_a610c4(); +} + +[[stage(compute)]] +fn compute_main() { + acos_a610c4(); +} diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl new file mode 100644 index 0000000000..d30ba41ede --- /dev/null +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void acos_a610c4() { + float3 res = acos(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + acos_a610c4(); + return; +} + +void fragment_main() { + acos_a610c4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + acos_a610c4(); + return; +} + diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl new file mode 100644 index 0000000000..d5e7574921 --- /dev/null +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void acos_a610c4() { + float3 res = acos(float3()); +} + +vertex void vertex_main() { + acos_a610c4(); + return; +} + +fragment void fragment_main() { + acos_a610c4(); + return; +} + +kernel void compute_main() { + acos_a610c4(); + return; +} + diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm new file mode 100644 index 0000000000..1f6a49234c --- /dev/null +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %acos_a610c4 "acos_a610c4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%acos_a610c4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Acos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %acos_a610c4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %acos_a610c4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %acos_a610c4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl new file mode 100644 index 0000000000..8c17039c47 --- /dev/null +++ b/test/intrinsics/gen/acos/a610c4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn acos_a610c4() { + var res : vec3 = acos(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_a610c4(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_a610c4(); +} + +[[stage(compute)]] +fn compute_main() { + acos_a610c4(); +} diff --git a/test/intrinsics/gen/acos/dfc915.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl new file mode 100644 index 0000000000..d6962e0643 --- /dev/null +++ b/test/intrinsics/gen/acos/dfc915.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn acos_dfc915() { + var res: vec2 = acos(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_dfc915(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_dfc915(); +} + +[[stage(compute)]] +fn compute_main() { + acos_dfc915(); +} diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl new file mode 100644 index 0000000000..9ae2fb0a7a --- /dev/null +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void acos_dfc915() { + float2 res = acos(float2(0.0f, 0.0f)); +} + +void vertex_main() { + acos_dfc915(); + return; +} + +void fragment_main() { + acos_dfc915(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + acos_dfc915(); + return; +} + diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl new file mode 100644 index 0000000000..f0b5e6d988 --- /dev/null +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void acos_dfc915() { + float2 res = acos(float2()); +} + +vertex void vertex_main() { + acos_dfc915(); + return; +} + +fragment void fragment_main() { + acos_dfc915(); + return; +} + +kernel void compute_main() { + acos_dfc915(); + return; +} + diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm new file mode 100644 index 0000000000..47e584dea1 --- /dev/null +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %acos_dfc915 "acos_dfc915" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%acos_dfc915 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Acos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %acos_dfc915 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %acos_dfc915 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %acos_dfc915 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl new file mode 100644 index 0000000000..2ee1383071 --- /dev/null +++ b/test/intrinsics/gen/acos/dfc915.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn acos_dfc915() { + var res : vec2 = acos(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + acos_dfc915(); +} + +[[stage(fragment)]] +fn fragment_main() { + acos_dfc915(); +} + +[[stage(compute)]] +fn compute_main() { + acos_dfc915(); +} diff --git a/test/intrinsics/gen/all/986c7b.wgsl b/test/intrinsics/gen/all/986c7b.wgsl new file mode 100644 index 0000000000..ccef7223af --- /dev/null +++ b/test/intrinsics/gen/all/986c7b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn all_986c7b() { + var res: bool = all(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_986c7b(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_986c7b(); +} + +[[stage(compute)]] +fn compute_main() { + all_986c7b(); +} diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl new file mode 100644 index 0000000000..ddb983b462 --- /dev/null +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void all_986c7b() { + bool res = all(vector(false, false, false, false)); +} + +void vertex_main() { + all_986c7b(); + return; +} + +void fragment_main() { + all_986c7b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + all_986c7b(); + return; +} + diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.msl b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl new file mode 100644 index 0000000000..702a3655f4 --- /dev/null +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void all_986c7b() { + bool res = all(bool4()); +} + +vertex void vertex_main() { + all_986c7b(); + return; +} + +fragment void fragment_main() { + all_986c7b(); + return; +} + +kernel void compute_main() { + all_986c7b(); + return; +} + diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm new file mode 100644 index 0000000000..2c6a391824 --- /dev/null +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %all_986c7b "all_986c7b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %12 = OpConstantNull %v4bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %all_986c7b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAll %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %all_986c7b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %all_986c7b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %all_986c7b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl new file mode 100644 index 0000000000..16db50e4e0 --- /dev/null +++ b/test/intrinsics/gen/all/986c7b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn all_986c7b() { + var res : bool = all(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_986c7b(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_986c7b(); +} + +[[stage(compute)]] +fn compute_main() { + all_986c7b(); +} diff --git a/test/intrinsics/gen/all/bd2dba.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl new file mode 100644 index 0000000000..69853b7f57 --- /dev/null +++ b/test/intrinsics/gen/all/bd2dba.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn all_bd2dba() { + var res: bool = all(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_bd2dba(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_bd2dba(); +} + +[[stage(compute)]] +fn compute_main() { + all_bd2dba(); +} diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl new file mode 100644 index 0000000000..f49a0e7519 --- /dev/null +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void all_bd2dba() { + bool res = all(vector(false, false, false)); +} + +void vertex_main() { + all_bd2dba(); + return; +} + +void fragment_main() { + all_bd2dba(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + all_bd2dba(); + return; +} + diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl new file mode 100644 index 0000000000..3425ed2ec2 --- /dev/null +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void all_bd2dba() { + bool res = all(bool3()); +} + +vertex void vertex_main() { + all_bd2dba(); + return; +} + +fragment void fragment_main() { + all_bd2dba(); + return; +} + +kernel void compute_main() { + all_bd2dba(); + return; +} + diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm new file mode 100644 index 0000000000..8c95c4570d --- /dev/null +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %all_bd2dba "all_bd2dba" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %12 = OpConstantNull %v3bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %all_bd2dba = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAll %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %all_bd2dba + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %all_bd2dba + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %all_bd2dba + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl new file mode 100644 index 0000000000..718116c835 --- /dev/null +++ b/test/intrinsics/gen/all/bd2dba.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn all_bd2dba() { + var res : bool = all(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_bd2dba(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_bd2dba(); +} + +[[stage(compute)]] +fn compute_main() { + all_bd2dba(); +} diff --git a/test/intrinsics/gen/all/f46790.wgsl b/test/intrinsics/gen/all/f46790.wgsl new file mode 100644 index 0000000000..541a718c4a --- /dev/null +++ b/test/intrinsics/gen/all/f46790.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn all_f46790() { + var res: bool = all(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_f46790(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_f46790(); +} + +[[stage(compute)]] +fn compute_main() { + all_f46790(); +} diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl new file mode 100644 index 0000000000..6b954b66f6 --- /dev/null +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void all_f46790() { + bool res = all(vector(false, false)); +} + +void vertex_main() { + all_f46790(); + return; +} + +void fragment_main() { + all_f46790(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + all_f46790(); + return; +} + diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.msl b/test/intrinsics/gen/all/f46790.wgsl.expected.msl new file mode 100644 index 0000000000..3c9019a5ae --- /dev/null +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void all_f46790() { + bool res = all(bool2()); +} + +vertex void vertex_main() { + all_f46790(); + return; +} + +fragment void fragment_main() { + all_f46790(); + return; +} + +kernel void compute_main() { + all_f46790(); + return; +} + diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm new file mode 100644 index 0000000000..081db4a7d4 --- /dev/null +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %all_f46790 "all_f46790" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %12 = OpConstantNull %v2bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %all_f46790 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAll %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %all_f46790 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %all_f46790 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %all_f46790 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl new file mode 100644 index 0000000000..2b156aed7d --- /dev/null +++ b/test/intrinsics/gen/all/f46790.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn all_f46790() { + var res : bool = all(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + all_f46790(); +} + +[[stage(fragment)]] +fn fragment_main() { + all_f46790(); +} + +[[stage(compute)]] +fn compute_main() { + all_f46790(); +} diff --git a/test/intrinsics/gen/any/083428.wgsl b/test/intrinsics/gen/any/083428.wgsl new file mode 100644 index 0000000000..9453c9cd71 --- /dev/null +++ b/test/intrinsics/gen/any/083428.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn any_083428() { + var res: bool = any(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_083428(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_083428(); +} + +[[stage(compute)]] +fn compute_main() { + any_083428(); +} diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.hlsl b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl new file mode 100644 index 0000000000..10dfae8182 --- /dev/null +++ b/test/intrinsics/gen/any/083428.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void any_083428() { + bool res = any(vector(false, false, false, false)); +} + +void vertex_main() { + any_083428(); + return; +} + +void fragment_main() { + any_083428(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + any_083428(); + return; +} + diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.msl b/test/intrinsics/gen/any/083428.wgsl.expected.msl new file mode 100644 index 0000000000..08107920d7 --- /dev/null +++ b/test/intrinsics/gen/any/083428.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void any_083428() { + bool res = any(bool4()); +} + +vertex void vertex_main() { + any_083428(); + return; +} + +fragment void fragment_main() { + any_083428(); + return; +} + +kernel void compute_main() { + any_083428(); + return; +} + diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.spvasm b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm new file mode 100644 index 0000000000..8ed460e039 --- /dev/null +++ b/test/intrinsics/gen/any/083428.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %any_083428 "any_083428" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %12 = OpConstantNull %v4bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %any_083428 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAny %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %any_083428 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %any_083428 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %any_083428 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/any/083428.wgsl.expected.wgsl b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl new file mode 100644 index 0000000000..aa9e120e9e --- /dev/null +++ b/test/intrinsics/gen/any/083428.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn any_083428() { + var res : bool = any(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_083428(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_083428(); +} + +[[stage(compute)]] +fn compute_main() { + any_083428(); +} diff --git a/test/intrinsics/gen/any/0e3e58.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl new file mode 100644 index 0000000000..16806adc24 --- /dev/null +++ b/test/intrinsics/gen/any/0e3e58.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn any_0e3e58() { + var res: bool = any(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_0e3e58(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_0e3e58(); +} + +[[stage(compute)]] +fn compute_main() { + any_0e3e58(); +} diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl new file mode 100644 index 0000000000..a1f20004dd --- /dev/null +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void any_0e3e58() { + bool res = any(vector(false, false)); +} + +void vertex_main() { + any_0e3e58(); + return; +} + +void fragment_main() { + any_0e3e58(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + any_0e3e58(); + return; +} + diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl new file mode 100644 index 0000000000..b9ba7b21f9 --- /dev/null +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void any_0e3e58() { + bool res = any(bool2()); +} + +vertex void vertex_main() { + any_0e3e58(); + return; +} + +fragment void fragment_main() { + any_0e3e58(); + return; +} + +kernel void compute_main() { + any_0e3e58(); + return; +} + diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm new file mode 100644 index 0000000000..1bfea9ec62 --- /dev/null +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %any_0e3e58 "any_0e3e58" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %12 = OpConstantNull %v2bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %any_0e3e58 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAny %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %any_0e3e58 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %any_0e3e58 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %any_0e3e58 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl new file mode 100644 index 0000000000..7a8e246628 --- /dev/null +++ b/test/intrinsics/gen/any/0e3e58.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn any_0e3e58() { + var res : bool = any(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_0e3e58(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_0e3e58(); +} + +[[stage(compute)]] +fn compute_main() { + any_0e3e58(); +} diff --git a/test/intrinsics/gen/any/e755c1.wgsl b/test/intrinsics/gen/any/e755c1.wgsl new file mode 100644 index 0000000000..e1cef53b4b --- /dev/null +++ b/test/intrinsics/gen/any/e755c1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn any_e755c1() { + var res: bool = any(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_e755c1(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_e755c1(); +} + +[[stage(compute)]] +fn compute_main() { + any_e755c1(); +} diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl new file mode 100644 index 0000000000..677e6d5466 --- /dev/null +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void any_e755c1() { + bool res = any(vector(false, false, false)); +} + +void vertex_main() { + any_e755c1(); + return; +} + +void fragment_main() { + any_e755c1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + any_e755c1(); + return; +} + diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.msl b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl new file mode 100644 index 0000000000..33f94096d5 --- /dev/null +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void any_e755c1() { + bool res = any(bool3()); +} + +vertex void vertex_main() { + any_e755c1(); + return; +} + +fragment void fragment_main() { + any_e755c1(); + return; +} + +kernel void compute_main() { + any_e755c1(); + return; +} + diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm new file mode 100644 index 0000000000..613d10b141 --- /dev/null +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %any_e755c1 "any_e755c1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %12 = OpConstantNull %v3bool +%_ptr_Function_bool = OpTypePointer Function %bool + %15 = OpConstantNull %bool + %float_1 = OpConstant %float 1 + %any_e755c1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %15 + %9 = OpAny %bool %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %any_e755c1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %any_e755c1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %any_e755c1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl new file mode 100644 index 0000000000..ab6f7a7ea5 --- /dev/null +++ b/test/intrinsics/gen/any/e755c1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn any_e755c1() { + var res : bool = any(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + any_e755c1(); +} + +[[stage(fragment)]] +fn fragment_main() { + any_e755c1(); +} + +[[stage(compute)]] +fn compute_main() { + any_e755c1(); +} diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl new file mode 100644 index 0000000000..84239adc15 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl @@ -0,0 +1,47 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[block]] +struct SB { + arg_0: array; +}; +[[group(0), binding(0)]] var sb : [[access(read)]] SB; +fn arrayLength_647a40() { + var res: u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_647a40(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_647a40(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_647a40(); +} diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl new file mode 100644 index 0000000000..3d51ff4dfe --- /dev/null +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.hlsl @@ -0,0 +1,26 @@ + +ByteAddressBuffer sb : register(t0, space0); + +void arrayLength_647a40() { + uint tint_symbol_1 = 0u; + sb.GetDimensions(tint_symbol_1); + const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); + uint res = tint_symbol_2; +} + +void vertex_main() { + arrayLength_647a40(); + return; +} + +void fragment_main() { + arrayLength_647a40(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + arrayLength_647a40(); + return; +} + diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl new file mode 100644 index 0000000000..1eddd1f0af --- /dev/null +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.msl @@ -0,0 +1,30 @@ +SKIP: FAILED + + +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_647a40() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_647a40(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_647a40(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_647a40(); +} + +Failed to generate: error: Unknown import method: arrayLength diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm new file mode 100644 index 0000000000..4f70f0be73 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %SB "SB" + OpMemberName %SB 0 "arg_0" + OpName %sb "sb" + OpName %arrayLength_647a40 "arrayLength_647a40" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %SB Block + OpMemberDecorate %SB 0 Offset 0 + OpDecorate %_runtimearr_uint ArrayStride 4 + OpDecorate %sb NonWritable + OpDecorate %sb DescriptorSet 0 + OpDecorate %sb Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 +%_runtimearr_uint = OpTypeRuntimeArray %uint + %SB = OpTypeStruct %_runtimearr_uint +%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB + %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %void = OpTypeVoid + %10 = OpTypeFunction %void +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%arrayLength_647a40 = OpFunction %void None %10 + %13 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %17 + %14 = OpArrayLength %uint %sb 0 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %10 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %arrayLength_647a40 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %10 + %23 = OpLabel + %24 = OpFunctionCall %void %arrayLength_647a40 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %10 + %26 = OpLabel + %27 = OpFunctionCall %void %arrayLength_647a40 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl new file mode 100644 index 0000000000..4f420f8cb7 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/647a40.wgsl.expected.wgsl @@ -0,0 +1,25 @@ +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_647a40() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_647a40(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_647a40(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_647a40(); +} diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl new file mode 100644 index 0000000000..a502bf7a73 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl @@ -0,0 +1,47 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[block]] +struct SB { + arg_0: array; +}; +[[group(0), binding(0)]] var sb : [[access(read)]] SB; +fn arrayLength_721c9d() { + var res: u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_721c9d(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_721c9d(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_721c9d(); +} diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl new file mode 100644 index 0000000000..e7770ff236 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.hlsl @@ -0,0 +1,26 @@ + +ByteAddressBuffer sb : register(t0, space0); + +void arrayLength_721c9d() { + uint tint_symbol_1 = 0u; + sb.GetDimensions(tint_symbol_1); + const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); + uint res = tint_symbol_2; +} + +void vertex_main() { + arrayLength_721c9d(); + return; +} + +void fragment_main() { + arrayLength_721c9d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + arrayLength_721c9d(); + return; +} + diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl new file mode 100644 index 0000000000..16205136a0 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.msl @@ -0,0 +1,30 @@ +SKIP: FAILED + + +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_721c9d() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_721c9d(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_721c9d(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_721c9d(); +} + +Failed to generate: error: Unknown import method: arrayLength diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm new file mode 100644 index 0000000000..40294aa334 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.spvasm @@ -0,0 +1,66 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %SB "SB" + OpMemberName %SB 0 "arg_0" + OpName %sb "sb" + OpName %arrayLength_721c9d "arrayLength_721c9d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %SB Block + OpMemberDecorate %SB 0 Offset 0 + OpDecorate %_runtimearr_int ArrayStride 4 + OpDecorate %sb NonWritable + OpDecorate %sb DescriptorSet 0 + OpDecorate %sb Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 +%_runtimearr_int = OpTypeRuntimeArray %int + %SB = OpTypeStruct %_runtimearr_int +%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB + %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %void = OpTypeVoid + %10 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %18 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%arrayLength_721c9d = OpFunction %void None %10 + %13 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %18 + %14 = OpArrayLength %uint %sb 0 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %10 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %arrayLength_721c9d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %10 + %24 = OpLabel + %25 = OpFunctionCall %void %arrayLength_721c9d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %10 + %27 = OpLabel + %28 = OpFunctionCall %void %arrayLength_721c9d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl new file mode 100644 index 0000000000..57222b1222 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/721c9d.wgsl.expected.wgsl @@ -0,0 +1,25 @@ +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_721c9d() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_721c9d(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_721c9d(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_721c9d(); +} diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl new file mode 100644 index 0000000000..87e31e090b --- /dev/null +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl @@ -0,0 +1,47 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[block]] +struct SB { + arg_0: array; +}; +[[group(0), binding(0)]] var sb : [[access(read)]] SB; +fn arrayLength_b083be() { + var res: u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_b083be(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_b083be(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_b083be(); +} diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl new file mode 100644 index 0000000000..25c9fd0daa --- /dev/null +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.hlsl @@ -0,0 +1,26 @@ + +ByteAddressBuffer sb : register(t0, space0); + +void arrayLength_b083be() { + uint tint_symbol_1 = 0u; + sb.GetDimensions(tint_symbol_1); + const uint tint_symbol_2 = ((tint_symbol_1 - 0u) / 4u); + uint res = tint_symbol_2; +} + +void vertex_main() { + arrayLength_b083be(); + return; +} + +void fragment_main() { + arrayLength_b083be(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + arrayLength_b083be(); + return; +} + diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl new file mode 100644 index 0000000000..a3eaf1bd4b --- /dev/null +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.msl @@ -0,0 +1,30 @@ +SKIP: FAILED + + +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_b083be() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_b083be(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_b083be(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_b083be(); +} + +Failed to generate: error: Unknown import method: arrayLength diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm new file mode 100644 index 0000000000..33c66cb144 --- /dev/null +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %SB "SB" + OpMemberName %SB 0 "arg_0" + OpName %sb "sb" + OpName %arrayLength_b083be "arrayLength_b083be" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %SB Block + OpMemberDecorate %SB 0 Offset 0 + OpDecorate %_runtimearr_float ArrayStride 4 + OpDecorate %sb NonWritable + OpDecorate %sb DescriptorSet 0 + OpDecorate %sb Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 +%_runtimearr_float = OpTypeRuntimeArray %float + %SB = OpTypeStruct %_runtimearr_float +%_ptr_StorageBuffer_SB = OpTypePointer StorageBuffer %SB + %sb = OpVariable %_ptr_StorageBuffer_SB StorageBuffer + %void = OpTypeVoid + %9 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %17 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%arrayLength_b083be = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %17 + %13 = OpArrayLength %uint %sb 0 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %arrayLength_b083be + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %arrayLength_b083be + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %arrayLength_b083be + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl new file mode 100644 index 0000000000..0e156314da --- /dev/null +++ b/test/intrinsics/gen/arrayLength/b083be.wgsl.expected.wgsl @@ -0,0 +1,25 @@ +[[block]] +struct SB { + arg_0 : array; +}; + +[[group(0), binding(0)]] var sb : [[access(read)]] SB; + +fn arrayLength_b083be() { + var res : u32 = arrayLength(sb.arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + arrayLength_b083be(); +} + +[[stage(fragment)]] +fn fragment_main() { + arrayLength_b083be(); +} + +[[stage(compute)]] +fn compute_main() { + arrayLength_b083be(); +} diff --git a/test/intrinsics/gen/asin/064953.wgsl b/test/intrinsics/gen/asin/064953.wgsl new file mode 100644 index 0000000000..ce344004e2 --- /dev/null +++ b/test/intrinsics/gen/asin/064953.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn asin_064953() { + var res: vec4 = asin(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_064953(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_064953(); +} + +[[stage(compute)]] +fn compute_main() { + asin_064953(); +} diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl new file mode 100644 index 0000000000..1e260dc456 --- /dev/null +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void asin_064953() { + float4 res = asin(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + asin_064953(); + return; +} + +void fragment_main() { + asin_064953(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + asin_064953(); + return; +} + diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.msl b/test/intrinsics/gen/asin/064953.wgsl.expected.msl new file mode 100644 index 0000000000..ea21d8a8a6 --- /dev/null +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void asin_064953() { + float4 res = asin(float4()); +} + +vertex void vertex_main() { + asin_064953(); + return; +} + +fragment void fragment_main() { + asin_064953(); + return; +} + +kernel void compute_main() { + asin_064953(); + return; +} + diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm new file mode 100644 index 0000000000..e98a980ed8 --- /dev/null +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %asin_064953 "asin_064953" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%asin_064953 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Asin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %asin_064953 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %asin_064953 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %asin_064953 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl new file mode 100644 index 0000000000..0746a72439 --- /dev/null +++ b/test/intrinsics/gen/asin/064953.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn asin_064953() { + var res : vec4 = asin(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_064953(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_064953(); +} + +[[stage(compute)]] +fn compute_main() { + asin_064953(); +} diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl new file mode 100644 index 0000000000..1d522fa15b --- /dev/null +++ b/test/intrinsics/gen/asin/7b6a44.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn asin_7b6a44() { + var res: vec2 = asin(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_7b6a44(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_7b6a44(); +} + +[[stage(compute)]] +fn compute_main() { + asin_7b6a44(); +} diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl new file mode 100644 index 0000000000..a013ed10b6 --- /dev/null +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void asin_7b6a44() { + float2 res = asin(float2(0.0f, 0.0f)); +} + +void vertex_main() { + asin_7b6a44(); + return; +} + +void fragment_main() { + asin_7b6a44(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + asin_7b6a44(); + return; +} + diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl new file mode 100644 index 0000000000..8e9f1e5535 --- /dev/null +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void asin_7b6a44() { + float2 res = asin(float2()); +} + +vertex void vertex_main() { + asin_7b6a44(); + return; +} + +fragment void fragment_main() { + asin_7b6a44(); + return; +} + +kernel void compute_main() { + asin_7b6a44(); + return; +} + diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm new file mode 100644 index 0000000000..aca13bec0c --- /dev/null +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %asin_7b6a44 "asin_7b6a44" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%asin_7b6a44 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Asin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %asin_7b6a44 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %asin_7b6a44 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %asin_7b6a44 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl new file mode 100644 index 0000000000..20048a972b --- /dev/null +++ b/test/intrinsics/gen/asin/7b6a44.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn asin_7b6a44() { + var res : vec2 = asin(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_7b6a44(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_7b6a44(); +} + +[[stage(compute)]] +fn compute_main() { + asin_7b6a44(); +} diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl new file mode 100644 index 0000000000..047d99f6c5 --- /dev/null +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn asin_8cd9c9() { + var res: vec3 = asin(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_8cd9c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_8cd9c9(); +} + +[[stage(compute)]] +fn compute_main() { + asin_8cd9c9(); +} diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl new file mode 100644 index 0000000000..9215dcd138 --- /dev/null +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void asin_8cd9c9() { + float3 res = asin(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + asin_8cd9c9(); + return; +} + +void fragment_main() { + asin_8cd9c9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + asin_8cd9c9(); + return; +} + diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl new file mode 100644 index 0000000000..07bd712bd3 --- /dev/null +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void asin_8cd9c9() { + float3 res = asin(float3()); +} + +vertex void vertex_main() { + asin_8cd9c9(); + return; +} + +fragment void fragment_main() { + asin_8cd9c9(); + return; +} + +kernel void compute_main() { + asin_8cd9c9(); + return; +} + diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm new file mode 100644 index 0000000000..ca65452ae3 --- /dev/null +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %asin_8cd9c9 "asin_8cd9c9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%asin_8cd9c9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Asin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %asin_8cd9c9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %asin_8cd9c9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %asin_8cd9c9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl new file mode 100644 index 0000000000..a86e69f564 --- /dev/null +++ b/test/intrinsics/gen/asin/8cd9c9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn asin_8cd9c9() { + var res : vec3 = asin(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_8cd9c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_8cd9c9(); +} + +[[stage(compute)]] +fn compute_main() { + asin_8cd9c9(); +} diff --git a/test/intrinsics/gen/asin/c0c272.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl new file mode 100644 index 0000000000..6c7f9d6539 --- /dev/null +++ b/test/intrinsics/gen/asin/c0c272.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn asin_c0c272() { + var res: f32 = asin(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_c0c272(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_c0c272(); +} + +[[stage(compute)]] +fn compute_main() { + asin_c0c272(); +} diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl new file mode 100644 index 0000000000..2c5b742822 --- /dev/null +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void asin_c0c272() { + float res = asin(1.0f); +} + +void vertex_main() { + asin_c0c272(); + return; +} + +void fragment_main() { + asin_c0c272(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + asin_c0c272(); + return; +} + diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl new file mode 100644 index 0000000000..87b650d769 --- /dev/null +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void asin_c0c272() { + float res = asin(1.0f); +} + +vertex void vertex_main() { + asin_c0c272(); + return; +} + +fragment void fragment_main() { + asin_c0c272(); + return; +} + +kernel void compute_main() { + asin_c0c272(); + return; +} + diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm new file mode 100644 index 0000000000..7c1af87082 --- /dev/null +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %asin_c0c272 "asin_c0c272" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%asin_c0c272 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Asin %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %asin_c0c272 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %asin_c0c272 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %asin_c0c272 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl new file mode 100644 index 0000000000..dc482f3f4d --- /dev/null +++ b/test/intrinsics/gen/asin/c0c272.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn asin_c0c272() { + var res : f32 = asin(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + asin_c0c272(); +} + +[[stage(fragment)]] +fn fragment_main() { + asin_c0c272(); +} + +[[stage(compute)]] +fn compute_main() { + asin_c0c272(); +} diff --git a/test/intrinsics/gen/atan/02979a.wgsl b/test/intrinsics/gen/atan/02979a.wgsl new file mode 100644 index 0000000000..0756a8c5d2 --- /dev/null +++ b/test/intrinsics/gen/atan/02979a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan_02979a() { + var res: f32 = atan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_02979a(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_02979a(); +} + +[[stage(compute)]] +fn compute_main() { + atan_02979a(); +} diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl new file mode 100644 index 0000000000..03255a92a7 --- /dev/null +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void atan_02979a() { + float res = atan(1.0f); +} + +void vertex_main() { + atan_02979a(); + return; +} + +void fragment_main() { + atan_02979a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan_02979a(); + return; +} + diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.msl b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl new file mode 100644 index 0000000000..ad8db82ce1 --- /dev/null +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan_02979a() { + float res = atan(1.0f); +} + +vertex void vertex_main() { + atan_02979a(); + return; +} + +fragment void fragment_main() { + atan_02979a(); + return; +} + +kernel void compute_main() { + atan_02979a(); + return; +} + diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm new file mode 100644 index 0000000000..5b3a53c551 --- /dev/null +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan_02979a "atan_02979a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%atan_02979a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Atan %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %atan_02979a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %atan_02979a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %atan_02979a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl new file mode 100644 index 0000000000..02da0b040c --- /dev/null +++ b/test/intrinsics/gen/atan/02979a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan_02979a() { + var res : f32 = atan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_02979a(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_02979a(); +} + +[[stage(compute)]] +fn compute_main() { + atan_02979a(); +} diff --git a/test/intrinsics/gen/atan/331e6d.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl new file mode 100644 index 0000000000..2b4def577c --- /dev/null +++ b/test/intrinsics/gen/atan/331e6d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan_331e6d() { + var res: vec3 = atan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_331e6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_331e6d(); +} + +[[stage(compute)]] +fn compute_main() { + atan_331e6d(); +} diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl new file mode 100644 index 0000000000..69a677d615 --- /dev/null +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void atan_331e6d() { + float3 res = atan(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + atan_331e6d(); + return; +} + +void fragment_main() { + atan_331e6d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan_331e6d(); + return; +} + diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl new file mode 100644 index 0000000000..77fe0cb610 --- /dev/null +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan_331e6d() { + float3 res = atan(float3()); +} + +vertex void vertex_main() { + atan_331e6d(); + return; +} + +fragment void fragment_main() { + atan_331e6d(); + return; +} + +kernel void compute_main() { + atan_331e6d(); + return; +} + diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm new file mode 100644 index 0000000000..1a1c43d8e8 --- /dev/null +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan_331e6d "atan_331e6d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%atan_331e6d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Atan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan_331e6d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan_331e6d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan_331e6d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl new file mode 100644 index 0000000000..dd330018e1 --- /dev/null +++ b/test/intrinsics/gen/atan/331e6d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan_331e6d() { + var res : vec3 = atan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_331e6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_331e6d(); +} + +[[stage(compute)]] +fn compute_main() { + atan_331e6d(); +} diff --git a/test/intrinsics/gen/atan/a8b696.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl new file mode 100644 index 0000000000..ab30f52018 --- /dev/null +++ b/test/intrinsics/gen/atan/a8b696.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan_a8b696() { + var res: vec4 = atan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_a8b696(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_a8b696(); +} + +[[stage(compute)]] +fn compute_main() { + atan_a8b696(); +} diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl new file mode 100644 index 0000000000..10825e8ea2 --- /dev/null +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void atan_a8b696() { + float4 res = atan(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + atan_a8b696(); + return; +} + +void fragment_main() { + atan_a8b696(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan_a8b696(); + return; +} + diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl new file mode 100644 index 0000000000..3c5b1d703c --- /dev/null +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan_a8b696() { + float4 res = atan(float4()); +} + +vertex void vertex_main() { + atan_a8b696(); + return; +} + +fragment void fragment_main() { + atan_a8b696(); + return; +} + +kernel void compute_main() { + atan_a8b696(); + return; +} + diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm new file mode 100644 index 0000000000..88f67655e5 --- /dev/null +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan_a8b696 "atan_a8b696" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%atan_a8b696 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Atan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan_a8b696 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan_a8b696 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan_a8b696 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl new file mode 100644 index 0000000000..22e4087f3e --- /dev/null +++ b/test/intrinsics/gen/atan/a8b696.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan_a8b696() { + var res : vec4 = atan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_a8b696(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_a8b696(); +} + +[[stage(compute)]] +fn compute_main() { + atan_a8b696(); +} diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl new file mode 100644 index 0000000000..0ed39c1c8c --- /dev/null +++ b/test/intrinsics/gen/atan/ad96e4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan_ad96e4() { + var res: vec2 = atan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_ad96e4(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_ad96e4(); +} + +[[stage(compute)]] +fn compute_main() { + atan_ad96e4(); +} diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl new file mode 100644 index 0000000000..32b7f3618c --- /dev/null +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void atan_ad96e4() { + float2 res = atan(float2(0.0f, 0.0f)); +} + +void vertex_main() { + atan_ad96e4(); + return; +} + +void fragment_main() { + atan_ad96e4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan_ad96e4(); + return; +} + diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl new file mode 100644 index 0000000000..d4b1639126 --- /dev/null +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan_ad96e4() { + float2 res = atan(float2()); +} + +vertex void vertex_main() { + atan_ad96e4(); + return; +} + +fragment void fragment_main() { + atan_ad96e4(); + return; +} + +kernel void compute_main() { + atan_ad96e4(); + return; +} + diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm new file mode 100644 index 0000000000..4c1efbf740 --- /dev/null +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan_ad96e4 "atan_ad96e4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%atan_ad96e4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Atan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan_ad96e4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan_ad96e4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan_ad96e4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl new file mode 100644 index 0000000000..4806af3e94 --- /dev/null +++ b/test/intrinsics/gen/atan/ad96e4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan_ad96e4() { + var res : vec2 = atan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan_ad96e4(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan_ad96e4(); +} + +[[stage(compute)]] +fn compute_main() { + atan_ad96e4(); +} diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl new file mode 100644 index 0000000000..0d662ca83c --- /dev/null +++ b/test/intrinsics/gen/atan2/57fb13.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan2_57fb13() { + var res: vec2 = atan2(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_57fb13(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_57fb13(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_57fb13(); +} diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl new file mode 100644 index 0000000000..e511c42749 --- /dev/null +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void atan2_57fb13() { + float2 res = atan2(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + atan2_57fb13(); + return; +} + +void fragment_main() { + atan2_57fb13(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan2_57fb13(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl new file mode 100644 index 0000000000..e6adbc9f12 --- /dev/null +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan2_57fb13() { + float2 res = atan2(float2(), float2()); +} + +vertex void vertex_main() { + atan2_57fb13(); + return; +} + +fragment void fragment_main() { + atan2_57fb13(); + return; +} + +kernel void compute_main() { + atan2_57fb13(); + return; +} + diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm new file mode 100644 index 0000000000..5ad6a7bcbb --- /dev/null +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan2_57fb13 "atan2_57fb13" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%atan2_57fb13 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Atan2 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan2_57fb13 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan2_57fb13 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan2_57fb13 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl new file mode 100644 index 0000000000..9eeb50ea1e --- /dev/null +++ b/test/intrinsics/gen/atan2/57fb13.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan2_57fb13() { + var res : vec2 = atan2(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_57fb13(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_57fb13(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_57fb13(); +} diff --git a/test/intrinsics/gen/atan2/96057c.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl new file mode 100644 index 0000000000..c48ea4d89b --- /dev/null +++ b/test/intrinsics/gen/atan2/96057c.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan2_96057c() { + var res: f32 = atan2(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_96057c(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_96057c(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_96057c(); +} diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl new file mode 100644 index 0000000000..6148ace0f5 --- /dev/null +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void atan2_96057c() { + float res = atan2(1.0f, 1.0f); +} + +void vertex_main() { + atan2_96057c(); + return; +} + +void fragment_main() { + atan2_96057c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan2_96057c(); + return; +} + diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl new file mode 100644 index 0000000000..6dd610fcad --- /dev/null +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan2_96057c() { + float res = atan2(1.0f, 1.0f); +} + +vertex void vertex_main() { + atan2_96057c(); + return; +} + +fragment void fragment_main() { + atan2_96057c(); + return; +} + +kernel void compute_main() { + atan2_96057c(); + return; +} + diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm new file mode 100644 index 0000000000..2d93e05545 --- /dev/null +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan2_96057c "atan2_96057c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%atan2_96057c = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Atan2 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %atan2_96057c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %atan2_96057c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %atan2_96057c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl new file mode 100644 index 0000000000..5196c864fe --- /dev/null +++ b/test/intrinsics/gen/atan2/96057c.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan2_96057c() { + var res : f32 = atan2(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_96057c(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_96057c(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_96057c(); +} diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl new file mode 100644 index 0000000000..9803266040 --- /dev/null +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan2_a70d0d() { + var res: vec3 = atan2(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_a70d0d(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_a70d0d(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_a70d0d(); +} diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl new file mode 100644 index 0000000000..49a82da492 --- /dev/null +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void atan2_a70d0d() { + float3 res = atan2(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + atan2_a70d0d(); + return; +} + +void fragment_main() { + atan2_a70d0d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan2_a70d0d(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl new file mode 100644 index 0000000000..867ab02321 --- /dev/null +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan2_a70d0d() { + float3 res = atan2(float3(), float3()); +} + +vertex void vertex_main() { + atan2_a70d0d(); + return; +} + +fragment void fragment_main() { + atan2_a70d0d(); + return; +} + +kernel void compute_main() { + atan2_a70d0d(); + return; +} + diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm new file mode 100644 index 0000000000..8a2ce3a972 --- /dev/null +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan2_a70d0d "atan2_a70d0d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%atan2_a70d0d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Atan2 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan2_a70d0d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan2_a70d0d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan2_a70d0d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl new file mode 100644 index 0000000000..81cbd0b82f --- /dev/null +++ b/test/intrinsics/gen/atan2/a70d0d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan2_a70d0d() { + var res : vec3 = atan2(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_a70d0d(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_a70d0d(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_a70d0d(); +} diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl new file mode 100644 index 0000000000..19090fd66e --- /dev/null +++ b/test/intrinsics/gen/atan2/ae713e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn atan2_ae713e() { + var res: vec4 = atan2(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_ae713e(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_ae713e(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_ae713e(); +} diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl new file mode 100644 index 0000000000..a72a697946 --- /dev/null +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void atan2_ae713e() { + float4 res = atan2(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + atan2_ae713e(); + return; +} + +void fragment_main() { + atan2_ae713e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + atan2_ae713e(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl new file mode 100644 index 0000000000..5afdaf168f --- /dev/null +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void atan2_ae713e() { + float4 res = atan2(float4(), float4()); +} + +vertex void vertex_main() { + atan2_ae713e(); + return; +} + +fragment void fragment_main() { + atan2_ae713e(); + return; +} + +kernel void compute_main() { + atan2_ae713e(); + return; +} + diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm new file mode 100644 index 0000000000..f97c71eea5 --- /dev/null +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %atan2_ae713e "atan2_ae713e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%atan2_ae713e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Atan2 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %atan2_ae713e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %atan2_ae713e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %atan2_ae713e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl new file mode 100644 index 0000000000..1f36d2f3e0 --- /dev/null +++ b/test/intrinsics/gen/atan2/ae713e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn atan2_ae713e() { + var res : vec4 = atan2(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + atan2_ae713e(); +} + +[[stage(fragment)]] +fn fragment_main() { + atan2_ae713e(); +} + +[[stage(compute)]] +fn compute_main() { + atan2_ae713e(); +} diff --git a/test/intrinsics/gen/ceil/34064b.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl new file mode 100644 index 0000000000..3a761a8369 --- /dev/null +++ b/test/intrinsics/gen/ceil/34064b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ceil_34064b() { + var res: vec3 = ceil(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_34064b(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_34064b(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_34064b(); +} diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl new file mode 100644 index 0000000000..8a08ba8e5d --- /dev/null +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ceil_34064b() { + float3 res = ceil(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + ceil_34064b(); + return; +} + +void fragment_main() { + ceil_34064b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ceil_34064b(); + return; +} + diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl new file mode 100644 index 0000000000..bdee65cf31 --- /dev/null +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ceil_34064b() { + float3 res = ceil(float3()); +} + +vertex void vertex_main() { + ceil_34064b(); + return; +} + +fragment void fragment_main() { + ceil_34064b(); + return; +} + +kernel void compute_main() { + ceil_34064b(); + return; +} + diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm new file mode 100644 index 0000000000..93ef755a27 --- /dev/null +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ceil_34064b "ceil_34064b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%ceil_34064b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Ceil %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %ceil_34064b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %ceil_34064b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ceil_34064b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl new file mode 100644 index 0000000000..db216bd860 --- /dev/null +++ b/test/intrinsics/gen/ceil/34064b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ceil_34064b() { + var res : vec3 = ceil(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_34064b(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_34064b(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_34064b(); +} diff --git a/test/intrinsics/gen/ceil/678655.wgsl b/test/intrinsics/gen/ceil/678655.wgsl new file mode 100644 index 0000000000..d6fd59e099 --- /dev/null +++ b/test/intrinsics/gen/ceil/678655.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ceil_678655() { + var res: f32 = ceil(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_678655(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_678655(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_678655(); +} diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl new file mode 100644 index 0000000000..a4644710c8 --- /dev/null +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ceil_678655() { + float res = ceil(1.0f); +} + +void vertex_main() { + ceil_678655(); + return; +} + +void fragment_main() { + ceil_678655(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ceil_678655(); + return; +} + diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.msl b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl new file mode 100644 index 0000000000..2ee1b99c98 --- /dev/null +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ceil_678655() { + float res = ceil(1.0f); +} + +vertex void vertex_main() { + ceil_678655(); + return; +} + +fragment void fragment_main() { + ceil_678655(); + return; +} + +kernel void compute_main() { + ceil_678655(); + return; +} + diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm new file mode 100644 index 0000000000..7e9d904fad --- /dev/null +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ceil_678655 "ceil_678655" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%ceil_678655 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Ceil %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %ceil_678655 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %ceil_678655 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %ceil_678655 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl new file mode 100644 index 0000000000..93141ee49c --- /dev/null +++ b/test/intrinsics/gen/ceil/678655.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ceil_678655() { + var res : f32 = ceil(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_678655(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_678655(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_678655(); +} diff --git a/test/intrinsics/gen/ceil/96f597.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl new file mode 100644 index 0000000000..8be5f582ac --- /dev/null +++ b/test/intrinsics/gen/ceil/96f597.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ceil_96f597() { + var res: vec2 = ceil(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_96f597(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_96f597(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_96f597(); +} diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl new file mode 100644 index 0000000000..0c6ec138d6 --- /dev/null +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ceil_96f597() { + float2 res = ceil(float2(0.0f, 0.0f)); +} + +void vertex_main() { + ceil_96f597(); + return; +} + +void fragment_main() { + ceil_96f597(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ceil_96f597(); + return; +} + diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl new file mode 100644 index 0000000000..e7fac87e57 --- /dev/null +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ceil_96f597() { + float2 res = ceil(float2()); +} + +vertex void vertex_main() { + ceil_96f597(); + return; +} + +fragment void fragment_main() { + ceil_96f597(); + return; +} + +kernel void compute_main() { + ceil_96f597(); + return; +} + diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm new file mode 100644 index 0000000000..2c6fc2dbf7 --- /dev/null +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ceil_96f597 "ceil_96f597" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%ceil_96f597 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Ceil %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %ceil_96f597 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %ceil_96f597 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ceil_96f597 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl new file mode 100644 index 0000000000..0f19eb3b92 --- /dev/null +++ b/test/intrinsics/gen/ceil/96f597.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ceil_96f597() { + var res : vec2 = ceil(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_96f597(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_96f597(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_96f597(); +} diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl new file mode 100644 index 0000000000..bff6a37cf6 --- /dev/null +++ b/test/intrinsics/gen/ceil/b74c16.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ceil_b74c16() { + var res: vec4 = ceil(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_b74c16(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_b74c16(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_b74c16(); +} diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl new file mode 100644 index 0000000000..8a24e8fd8b --- /dev/null +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ceil_b74c16() { + float4 res = ceil(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + ceil_b74c16(); + return; +} + +void fragment_main() { + ceil_b74c16(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ceil_b74c16(); + return; +} + diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl new file mode 100644 index 0000000000..85755c87c1 --- /dev/null +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ceil_b74c16() { + float4 res = ceil(float4()); +} + +vertex void vertex_main() { + ceil_b74c16(); + return; +} + +fragment void fragment_main() { + ceil_b74c16(); + return; +} + +kernel void compute_main() { + ceil_b74c16(); + return; +} + diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm new file mode 100644 index 0000000000..8acc0f5e58 --- /dev/null +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ceil_b74c16 "ceil_b74c16" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%ceil_b74c16 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Ceil %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %ceil_b74c16 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %ceil_b74c16 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ceil_b74c16 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl new file mode 100644 index 0000000000..31a84dc532 --- /dev/null +++ b/test/intrinsics/gen/ceil/b74c16.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ceil_b74c16() { + var res : vec4 = ceil(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ceil_b74c16(); +} + +[[stage(fragment)]] +fn fragment_main() { + ceil_b74c16(); +} + +[[stage(compute)]] +fn compute_main() { + ceil_b74c16(); +} diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl new file mode 100644 index 0000000000..1cd0210de6 --- /dev/null +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_0acf8f() { + var res: vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_0acf8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_0acf8f(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_0acf8f(); +} diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl new file mode 100644 index 0000000000..842215f1c3 --- /dev/null +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_0acf8f() { + float2 res = clamp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + clamp_0acf8f(); + return; +} + +void fragment_main() { + clamp_0acf8f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_0acf8f(); + return; +} + diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl new file mode 100644 index 0000000000..a037369fb8 --- /dev/null +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_0acf8f() { + float2 res = clamp(float2(), float2(), float2()); +} + +vertex void vertex_main() { + clamp_0acf8f(); + return; +} + +fragment void fragment_main() { + clamp_0acf8f(); + return; +} + +kernel void compute_main() { + clamp_0acf8f(); + return; +} + diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm new file mode 100644 index 0000000000..407ba2e23d --- /dev/null +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_0acf8f "clamp_0acf8f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%clamp_0acf8f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 NClamp %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %clamp_0acf8f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %clamp_0acf8f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %clamp_0acf8f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl new file mode 100644 index 0000000000..bddaa44a8d --- /dev/null +++ b/test/intrinsics/gen/clamp/0acf8f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_0acf8f() { + var res : vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_0acf8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_0acf8f(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_0acf8f(); +} diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl new file mode 100644 index 0000000000..09c42a5cba --- /dev/null +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_1a32e3() { + var res: vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_1a32e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_1a32e3(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_1a32e3(); +} diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl new file mode 100644 index 0000000000..55b87de903 --- /dev/null +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_1a32e3() { + int4 res = clamp(int4(0, 0, 0, 0), int4(0, 0, 0, 0), int4(0, 0, 0, 0)); +} + +void vertex_main() { + clamp_1a32e3(); + return; +} + +void fragment_main() { + clamp_1a32e3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_1a32e3(); + return; +} + diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl new file mode 100644 index 0000000000..c0bea6f649 --- /dev/null +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_1a32e3() { + int4 res = clamp(int4(), int4(), int4()); +} + +vertex void vertex_main() { + clamp_1a32e3(); + return; +} + +fragment void fragment_main() { + clamp_1a32e3(); + return; +} + +kernel void compute_main() { + clamp_1a32e3(); + return; +} + diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm new file mode 100644 index 0000000000..33593799b4 --- /dev/null +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_1a32e3 "clamp_1a32e3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %13 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 +%clamp_1a32e3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %13 + %9 = OpExtInst %v4int %12 SClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_1a32e3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_1a32e3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_1a32e3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl new file mode 100644 index 0000000000..27ba95d975 --- /dev/null +++ b/test/intrinsics/gen/clamp/1a32e3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_1a32e3() { + var res : vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_1a32e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_1a32e3(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_1a32e3(); +} diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl new file mode 100644 index 0000000000..53f74c8f4f --- /dev/null +++ b/test/intrinsics/gen/clamp/2bd567.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_2bd567() { + var res: f32 = clamp(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_2bd567(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_2bd567(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_2bd567(); +} diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl new file mode 100644 index 0000000000..6650a46d0c --- /dev/null +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_2bd567() { + float res = clamp(1.0f, 1.0f, 1.0f); +} + +void vertex_main() { + clamp_2bd567(); + return; +} + +void fragment_main() { + clamp_2bd567(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_2bd567(); + return; +} + diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl new file mode 100644 index 0000000000..fd397f1988 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_2bd567() { + float res = clamp(1.0f, 1.0f, 1.0f); +} + +vertex void vertex_main() { + clamp_2bd567(); + return; +} + +fragment void fragment_main() { + clamp_2bd567(); + return; +} + +kernel void compute_main() { + clamp_2bd567(); + return; +} + diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm new file mode 100644 index 0000000000..74eb006834 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_2bd567 "clamp_2bd567" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%clamp_2bd567 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 NClamp %float_1 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %clamp_2bd567 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %clamp_2bd567 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_2bd567 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl new file mode 100644 index 0000000000..84ab121635 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bd567.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_2bd567() { + var res : f32 = clamp(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_2bd567(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_2bd567(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_2bd567(); +} diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl new file mode 100644 index 0000000000..d3e75b0e69 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bde41.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_2bde41() { + var res: vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_2bde41(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_2bde41(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_2bde41(); +} diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl new file mode 100644 index 0000000000..f6485cb037 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_2bde41() { + float4 res = clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + clamp_2bde41(); + return; +} + +void fragment_main() { + clamp_2bde41(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_2bde41(); + return; +} + diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl new file mode 100644 index 0000000000..300b88a087 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_2bde41() { + float4 res = clamp(float4(), float4(), float4()); +} + +vertex void vertex_main() { + clamp_2bde41(); + return; +} + +fragment void fragment_main() { + clamp_2bde41(); + return; +} + +kernel void compute_main() { + clamp_2bde41(); + return; +} + diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm new file mode 100644 index 0000000000..893bd08ef5 --- /dev/null +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_2bde41 "clamp_2bde41" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%clamp_2bde41 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 NClamp %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %clamp_2bde41 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %clamp_2bde41 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %clamp_2bde41 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl new file mode 100644 index 0000000000..5956f67d6e --- /dev/null +++ b/test/intrinsics/gen/clamp/2bde41.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_2bde41() { + var res : vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_2bde41(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_2bde41(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_2bde41(); +} diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl new file mode 100644 index 0000000000..c1c22c5836 --- /dev/null +++ b/test/intrinsics/gen/clamp/548fc7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_548fc7() { + var res: vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_548fc7(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_548fc7(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_548fc7(); +} diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl new file mode 100644 index 0000000000..019054e243 --- /dev/null +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_548fc7() { + uint3 res = clamp(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); +} + +void vertex_main() { + clamp_548fc7(); + return; +} + +void fragment_main() { + clamp_548fc7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_548fc7(); + return; +} + diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl new file mode 100644 index 0000000000..cd95893cf1 --- /dev/null +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_548fc7() { + uint3 res = clamp(uint3(), uint3(), uint3()); +} + +vertex void vertex_main() { + clamp_548fc7(); + return; +} + +fragment void fragment_main() { + clamp_548fc7(); + return; +} + +kernel void compute_main() { + clamp_548fc7(); + return; +} + diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm new file mode 100644 index 0000000000..37f7fb724f --- /dev/null +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_548fc7 "clamp_548fc7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %13 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 +%clamp_548fc7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %13 + %9 = OpExtInst %v3uint %12 UClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_548fc7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_548fc7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_548fc7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl new file mode 100644 index 0000000000..0a5ebca187 --- /dev/null +++ b/test/intrinsics/gen/clamp/548fc7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_548fc7() { + var res : vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_548fc7(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_548fc7(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_548fc7(); +} diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl new file mode 100644 index 0000000000..3f832c6a6e --- /dev/null +++ b/test/intrinsics/gen/clamp/5f0819.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_5f0819() { + var res: vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_5f0819(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_5f0819(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_5f0819(); +} diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl new file mode 100644 index 0000000000..4c53393f18 --- /dev/null +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_5f0819() { + int3 res = clamp(int3(0, 0, 0), int3(0, 0, 0), int3(0, 0, 0)); +} + +void vertex_main() { + clamp_5f0819(); + return; +} + +void fragment_main() { + clamp_5f0819(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_5f0819(); + return; +} + diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl new file mode 100644 index 0000000000..758dfaf4f7 --- /dev/null +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_5f0819() { + int3 res = clamp(int3(), int3(), int3()); +} + +vertex void vertex_main() { + clamp_5f0819(); + return; +} + +fragment void fragment_main() { + clamp_5f0819(); + return; +} + +kernel void compute_main() { + clamp_5f0819(); + return; +} + diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm new file mode 100644 index 0000000000..4d75c73da6 --- /dev/null +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_5f0819 "clamp_5f0819" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %13 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 +%clamp_5f0819 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %13 + %9 = OpExtInst %v3int %12 SClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_5f0819 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_5f0819 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_5f0819 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl new file mode 100644 index 0000000000..5490dffe7c --- /dev/null +++ b/test/intrinsics/gen/clamp/5f0819.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_5f0819() { + var res : vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_5f0819(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_5f0819(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_5f0819(); +} diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl new file mode 100644 index 0000000000..50c6ecb103 --- /dev/null +++ b/test/intrinsics/gen/clamp/6c1749.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_6c1749() { + var res: vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_6c1749(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_6c1749(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_6c1749(); +} diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl new file mode 100644 index 0000000000..df7017785c --- /dev/null +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_6c1749() { + int2 res = clamp(int2(0, 0), int2(0, 0), int2(0, 0)); +} + +void vertex_main() { + clamp_6c1749(); + return; +} + +void fragment_main() { + clamp_6c1749(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_6c1749(); + return; +} + diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl new file mode 100644 index 0000000000..34397b698c --- /dev/null +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_6c1749() { + int2 res = clamp(int2(), int2(), int2()); +} + +vertex void vertex_main() { + clamp_6c1749(); + return; +} + +fragment void fragment_main() { + clamp_6c1749(); + return; +} + +kernel void compute_main() { + clamp_6c1749(); + return; +} + diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm new file mode 100644 index 0000000000..892edafa11 --- /dev/null +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_6c1749 "clamp_6c1749" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %13 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 +%clamp_6c1749 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %13 + %9 = OpExtInst %v2int %12 SClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_6c1749 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_6c1749 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_6c1749 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl new file mode 100644 index 0000000000..bc424ecc91 --- /dev/null +++ b/test/intrinsics/gen/clamp/6c1749.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_6c1749() { + var res : vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_6c1749(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_6c1749(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_6c1749(); +} diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl new file mode 100644 index 0000000000..20b0214947 --- /dev/null +++ b/test/intrinsics/gen/clamp/7706d7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_7706d7() { + var res: vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_7706d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_7706d7(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_7706d7(); +} diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl new file mode 100644 index 0000000000..ac8e422919 --- /dev/null +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_7706d7() { + uint2 res = clamp(uint2(0u, 0u), uint2(0u, 0u), uint2(0u, 0u)); +} + +void vertex_main() { + clamp_7706d7(); + return; +} + +void fragment_main() { + clamp_7706d7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_7706d7(); + return; +} + diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl new file mode 100644 index 0000000000..4faae26326 --- /dev/null +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_7706d7() { + uint2 res = clamp(uint2(), uint2(), uint2()); +} + +vertex void vertex_main() { + clamp_7706d7(); + return; +} + +fragment void fragment_main() { + clamp_7706d7(); + return; +} + +kernel void compute_main() { + clamp_7706d7(); + return; +} + diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm new file mode 100644 index 0000000000..5ecc8de93c --- /dev/null +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_7706d7 "clamp_7706d7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %13 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 +%clamp_7706d7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %13 + %9 = OpExtInst %v2uint %12 UClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_7706d7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_7706d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_7706d7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl new file mode 100644 index 0000000000..76996d8143 --- /dev/null +++ b/test/intrinsics/gen/clamp/7706d7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_7706d7() { + var res : vec2 = clamp(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_7706d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_7706d7(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_7706d7(); +} diff --git a/test/intrinsics/gen/clamp/867397.wgsl b/test/intrinsics/gen/clamp/867397.wgsl new file mode 100644 index 0000000000..51dbf3ab08 --- /dev/null +++ b/test/intrinsics/gen/clamp/867397.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_867397() { + var res: vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_867397(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_867397(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_867397(); +} diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb3b131b9c --- /dev/null +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_867397() { + float3 res = clamp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + clamp_867397(); + return; +} + +void fragment_main() { + clamp_867397(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_867397(); + return; +} + diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.msl b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl new file mode 100644 index 0000000000..a3647ecf07 --- /dev/null +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_867397() { + float3 res = clamp(float3(), float3(), float3()); +} + +vertex void vertex_main() { + clamp_867397(); + return; +} + +fragment void fragment_main() { + clamp_867397(); + return; +} + +kernel void compute_main() { + clamp_867397(); + return; +} + diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm new file mode 100644 index 0000000000..f635487891 --- /dev/null +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_867397 "clamp_867397" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%clamp_867397 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 NClamp %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %clamp_867397 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %clamp_867397 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %clamp_867397 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl new file mode 100644 index 0000000000..ee22ec7167 --- /dev/null +++ b/test/intrinsics/gen/clamp/867397.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_867397() { + var res : vec3 = clamp(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_867397(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_867397(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_867397(); +} diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl new file mode 100644 index 0000000000..57398aeb78 --- /dev/null +++ b/test/intrinsics/gen/clamp/a2de25.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_a2de25() { + var res: u32 = clamp(1u, 1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_a2de25(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_a2de25(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_a2de25(); +} diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl new file mode 100644 index 0000000000..d051684212 --- /dev/null +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_a2de25() { + uint res = clamp(1u, 1u, 1u); +} + +void vertex_main() { + clamp_a2de25(); + return; +} + +void fragment_main() { + clamp_a2de25(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_a2de25(); + return; +} + diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl new file mode 100644 index 0000000000..723dcceed3 --- /dev/null +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_a2de25() { + uint res = clamp(1u, 1u, 1u); +} + +vertex void vertex_main() { + clamp_a2de25(); + return; +} + +fragment void fragment_main() { + clamp_a2de25(); + return; +} + +kernel void compute_main() { + clamp_a2de25(); + return; +} + diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm new file mode 100644 index 0000000000..1e40fa932c --- /dev/null +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_a2de25 "clamp_a2de25" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%clamp_a2de25 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %15 + %9 = OpExtInst %uint %11 UClamp %uint_1 %uint_1 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_a2de25 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_a2de25 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_a2de25 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl new file mode 100644 index 0000000000..dcc288b402 --- /dev/null +++ b/test/intrinsics/gen/clamp/a2de25.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_a2de25() { + var res : u32 = clamp(1u, 1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_a2de25(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_a2de25(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_a2de25(); +} diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl new file mode 100644 index 0000000000..26037c0421 --- /dev/null +++ b/test/intrinsics/gen/clamp/b07c65.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_b07c65() { + var res: i32 = clamp(1, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_b07c65(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_b07c65(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_b07c65(); +} diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl new file mode 100644 index 0000000000..1e0f3b794a --- /dev/null +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_b07c65() { + int res = clamp(1, 1, 1); +} + +void vertex_main() { + clamp_b07c65(); + return; +} + +void fragment_main() { + clamp_b07c65(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_b07c65(); + return; +} + diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl new file mode 100644 index 0000000000..66c5ed1496 --- /dev/null +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_b07c65() { + int res = clamp(1, 1, 1); +} + +vertex void vertex_main() { + clamp_b07c65(); + return; +} + +fragment void fragment_main() { + clamp_b07c65(); + return; +} + +kernel void compute_main() { + clamp_b07c65(); + return; +} + diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm new file mode 100644 index 0000000000..766f94820a --- /dev/null +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_b07c65 "clamp_b07c65" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %15 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%clamp_b07c65 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %15 + %9 = OpExtInst %int %11 SClamp %int_1 %int_1 %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_b07c65 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_b07c65 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_b07c65 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl new file mode 100644 index 0000000000..dcb8defd2e --- /dev/null +++ b/test/intrinsics/gen/clamp/b07c65.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_b07c65() { + var res : i32 = clamp(1, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_b07c65(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_b07c65(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_b07c65(); +} diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl new file mode 100644 index 0000000000..312f5a40bf --- /dev/null +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn clamp_bd43ce() { + var res: vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_bd43ce(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_bd43ce(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_bd43ce(); +} diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl new file mode 100644 index 0000000000..aff6b0a401 --- /dev/null +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void clamp_bd43ce() { + uint4 res = clamp(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + clamp_bd43ce(); + return; +} + +void fragment_main() { + clamp_bd43ce(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + clamp_bd43ce(); + return; +} + diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl new file mode 100644 index 0000000000..635750321d --- /dev/null +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void clamp_bd43ce() { + uint4 res = clamp(uint4(), uint4(), uint4()); +} + +vertex void vertex_main() { + clamp_bd43ce(); + return; +} + +fragment void fragment_main() { + clamp_bd43ce(); + return; +} + +kernel void compute_main() { + clamp_bd43ce(); + return; +} + diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm new file mode 100644 index 0000000000..2d2fc1ffe7 --- /dev/null +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %clamp_bd43ce "clamp_bd43ce" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %13 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 +%clamp_bd43ce = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %13 + %9 = OpExtInst %v4uint %12 UClamp %13 %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %clamp_bd43ce + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %clamp_bd43ce + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %clamp_bd43ce + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl new file mode 100644 index 0000000000..83486f023d --- /dev/null +++ b/test/intrinsics/gen/clamp/bd43ce.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn clamp_bd43ce() { + var res : vec4 = clamp(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + clamp_bd43ce(); +} + +[[stage(fragment)]] +fn fragment_main() { + clamp_bd43ce(); +} + +[[stage(compute)]] +fn compute_main() { + clamp_bd43ce(); +} diff --git a/test/intrinsics/gen/cos/16dc15.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl new file mode 100644 index 0000000000..3be644c484 --- /dev/null +++ b/test/intrinsics/gen/cos/16dc15.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cos_16dc15() { + var res: vec3 = cos(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_16dc15(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_16dc15(); +} + +[[stage(compute)]] +fn compute_main() { + cos_16dc15(); +} diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl new file mode 100644 index 0000000000..a7f13151c2 --- /dev/null +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cos_16dc15() { + float3 res = cos(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + cos_16dc15(); + return; +} + +void fragment_main() { + cos_16dc15(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cos_16dc15(); + return; +} + diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl new file mode 100644 index 0000000000..f82f797654 --- /dev/null +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cos_16dc15() { + float3 res = cos(float3()); +} + +vertex void vertex_main() { + cos_16dc15(); + return; +} + +fragment void fragment_main() { + cos_16dc15(); + return; +} + +kernel void compute_main() { + cos_16dc15(); + return; +} + diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm new file mode 100644 index 0000000000..e9373f8efb --- /dev/null +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cos_16dc15 "cos_16dc15" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %cos_16dc15 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Cos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cos_16dc15 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cos_16dc15 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cos_16dc15 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl new file mode 100644 index 0000000000..556d991e02 --- /dev/null +++ b/test/intrinsics/gen/cos/16dc15.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cos_16dc15() { + var res : vec3 = cos(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_16dc15(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_16dc15(); +} + +[[stage(compute)]] +fn compute_main() { + cos_16dc15(); +} diff --git a/test/intrinsics/gen/cos/29d66d.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl new file mode 100644 index 0000000000..ac2ac10a23 --- /dev/null +++ b/test/intrinsics/gen/cos/29d66d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cos_29d66d() { + var res: vec4 = cos(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_29d66d(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_29d66d(); +} + +[[stage(compute)]] +fn compute_main() { + cos_29d66d(); +} diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl new file mode 100644 index 0000000000..745c39dec7 --- /dev/null +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cos_29d66d() { + float4 res = cos(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + cos_29d66d(); + return; +} + +void fragment_main() { + cos_29d66d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cos_29d66d(); + return; +} + diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl new file mode 100644 index 0000000000..a434caba0f --- /dev/null +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cos_29d66d() { + float4 res = cos(float4()); +} + +vertex void vertex_main() { + cos_29d66d(); + return; +} + +fragment void fragment_main() { + cos_29d66d(); + return; +} + +kernel void compute_main() { + cos_29d66d(); + return; +} + diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm new file mode 100644 index 0000000000..b3064677a8 --- /dev/null +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cos_29d66d "cos_29d66d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %cos_29d66d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Cos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cos_29d66d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cos_29d66d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cos_29d66d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl new file mode 100644 index 0000000000..1ae251cb23 --- /dev/null +++ b/test/intrinsics/gen/cos/29d66d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cos_29d66d() { + var res : vec4 = cos(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_29d66d(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_29d66d(); +} + +[[stage(compute)]] +fn compute_main() { + cos_29d66d(); +} diff --git a/test/intrinsics/gen/cos/c3b486.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl new file mode 100644 index 0000000000..dd860bec11 --- /dev/null +++ b/test/intrinsics/gen/cos/c3b486.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cos_c3b486() { + var res: vec2 = cos(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_c3b486(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_c3b486(); +} + +[[stage(compute)]] +fn compute_main() { + cos_c3b486(); +} diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl new file mode 100644 index 0000000000..98a4176150 --- /dev/null +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cos_c3b486() { + float2 res = cos(float2(0.0f, 0.0f)); +} + +void vertex_main() { + cos_c3b486(); + return; +} + +void fragment_main() { + cos_c3b486(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cos_c3b486(); + return; +} + diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl new file mode 100644 index 0000000000..2d82317859 --- /dev/null +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cos_c3b486() { + float2 res = cos(float2()); +} + +vertex void vertex_main() { + cos_c3b486(); + return; +} + +fragment void fragment_main() { + cos_c3b486(); + return; +} + +kernel void compute_main() { + cos_c3b486(); + return; +} + diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm new file mode 100644 index 0000000000..14f77a8d12 --- /dev/null +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cos_c3b486 "cos_c3b486" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %cos_c3b486 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Cos %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cos_c3b486 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cos_c3b486 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cos_c3b486 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl new file mode 100644 index 0000000000..2d585d6dda --- /dev/null +++ b/test/intrinsics/gen/cos/c3b486.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cos_c3b486() { + var res : vec2 = cos(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_c3b486(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_c3b486(); +} + +[[stage(compute)]] +fn compute_main() { + cos_c3b486(); +} diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl new file mode 100644 index 0000000000..33bc9f4d43 --- /dev/null +++ b/test/intrinsics/gen/cos/c5c28e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cos_c5c28e() { + var res: f32 = cos(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_c5c28e(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_c5c28e(); +} + +[[stage(compute)]] +fn compute_main() { + cos_c5c28e(); +} diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl new file mode 100644 index 0000000000..fbd531bbe5 --- /dev/null +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cos_c5c28e() { + float res = cos(1.0f); +} + +void vertex_main() { + cos_c5c28e(); + return; +} + +void fragment_main() { + cos_c5c28e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cos_c5c28e(); + return; +} + diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl new file mode 100644 index 0000000000..0f1eba6698 --- /dev/null +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cos_c5c28e() { + float res = cos(1.0f); +} + +vertex void vertex_main() { + cos_c5c28e(); + return; +} + +fragment void fragment_main() { + cos_c5c28e(); + return; +} + +kernel void compute_main() { + cos_c5c28e(); + return; +} + diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm new file mode 100644 index 0000000000..1183128cdb --- /dev/null +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cos_c5c28e "cos_c5c28e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %cos_c5c28e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Cos %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %cos_c5c28e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %cos_c5c28e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %cos_c5c28e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl new file mode 100644 index 0000000000..b4a0453cdf --- /dev/null +++ b/test/intrinsics/gen/cos/c5c28e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cos_c5c28e() { + var res : f32 = cos(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + cos_c5c28e(); +} + +[[stage(fragment)]] +fn fragment_main() { + cos_c5c28e(); +} + +[[stage(compute)]] +fn compute_main() { + cos_c5c28e(); +} diff --git a/test/intrinsics/gen/cosh/377652.wgsl b/test/intrinsics/gen/cosh/377652.wgsl new file mode 100644 index 0000000000..c4e548e2bf --- /dev/null +++ b/test/intrinsics/gen/cosh/377652.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cosh_377652() { + var res: vec3 = cosh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_377652(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_377652(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_377652(); +} diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl new file mode 100644 index 0000000000..019f1f4932 --- /dev/null +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cosh_377652() { + float3 res = cosh(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + cosh_377652(); + return; +} + +void fragment_main() { + cosh_377652(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cosh_377652(); + return; +} + diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.msl b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl new file mode 100644 index 0000000000..0fe5e89afe --- /dev/null +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cosh_377652() { + float3 res = cosh(float3()); +} + +vertex void vertex_main() { + cosh_377652(); + return; +} + +fragment void fragment_main() { + cosh_377652(); + return; +} + +kernel void compute_main() { + cosh_377652(); + return; +} + diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm new file mode 100644 index 0000000000..e007f05f0f --- /dev/null +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cosh_377652 "cosh_377652" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%cosh_377652 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Cosh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cosh_377652 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cosh_377652 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cosh_377652 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl new file mode 100644 index 0000000000..29fffea113 --- /dev/null +++ b/test/intrinsics/gen/cosh/377652.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cosh_377652() { + var res : vec3 = cosh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_377652(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_377652(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_377652(); +} diff --git a/test/intrinsics/gen/cosh/c13756.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl new file mode 100644 index 0000000000..8d6aced307 --- /dev/null +++ b/test/intrinsics/gen/cosh/c13756.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cosh_c13756() { + var res: vec2 = cosh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_c13756(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_c13756(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_c13756(); +} diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl new file mode 100644 index 0000000000..72480bef43 --- /dev/null +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cosh_c13756() { + float2 res = cosh(float2(0.0f, 0.0f)); +} + +void vertex_main() { + cosh_c13756(); + return; +} + +void fragment_main() { + cosh_c13756(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cosh_c13756(); + return; +} + diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl new file mode 100644 index 0000000000..8d9d463119 --- /dev/null +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cosh_c13756() { + float2 res = cosh(float2()); +} + +vertex void vertex_main() { + cosh_c13756(); + return; +} + +fragment void fragment_main() { + cosh_c13756(); + return; +} + +kernel void compute_main() { + cosh_c13756(); + return; +} + diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm new file mode 100644 index 0000000000..75734514d3 --- /dev/null +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cosh_c13756 "cosh_c13756" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%cosh_c13756 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Cosh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cosh_c13756 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cosh_c13756 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cosh_c13756 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl new file mode 100644 index 0000000000..688528bc8c --- /dev/null +++ b/test/intrinsics/gen/cosh/c13756.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cosh_c13756() { + var res : vec2 = cosh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_c13756(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_c13756(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_c13756(); +} diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl new file mode 100644 index 0000000000..da5876c437 --- /dev/null +++ b/test/intrinsics/gen/cosh/da92dd.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cosh_da92dd() { + var res: f32 = cosh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_da92dd(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_da92dd(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_da92dd(); +} diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl new file mode 100644 index 0000000000..0452df9db3 --- /dev/null +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cosh_da92dd() { + float res = cosh(1.0f); +} + +void vertex_main() { + cosh_da92dd(); + return; +} + +void fragment_main() { + cosh_da92dd(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cosh_da92dd(); + return; +} + diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl new file mode 100644 index 0000000000..1455bf76d3 --- /dev/null +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cosh_da92dd() { + float res = cosh(1.0f); +} + +vertex void vertex_main() { + cosh_da92dd(); + return; +} + +fragment void fragment_main() { + cosh_da92dd(); + return; +} + +kernel void compute_main() { + cosh_da92dd(); + return; +} + diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm new file mode 100644 index 0000000000..3ff45d5072 --- /dev/null +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cosh_da92dd "cosh_da92dd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%cosh_da92dd = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Cosh %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %cosh_da92dd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %cosh_da92dd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %cosh_da92dd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl new file mode 100644 index 0000000000..b2c83f851e --- /dev/null +++ b/test/intrinsics/gen/cosh/da92dd.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cosh_da92dd() { + var res : f32 = cosh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_da92dd(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_da92dd(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_da92dd(); +} diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl new file mode 100644 index 0000000000..39b3c46edf --- /dev/null +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cosh_e0c1de() { + var res: vec4 = cosh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_e0c1de(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_e0c1de(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_e0c1de(); +} diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl new file mode 100644 index 0000000000..02e0258d4d --- /dev/null +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cosh_e0c1de() { + float4 res = cosh(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + cosh_e0c1de(); + return; +} + +void fragment_main() { + cosh_e0c1de(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cosh_e0c1de(); + return; +} + diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl new file mode 100644 index 0000000000..aaf2735e8a --- /dev/null +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cosh_e0c1de() { + float4 res = cosh(float4()); +} + +vertex void vertex_main() { + cosh_e0c1de(); + return; +} + +fragment void fragment_main() { + cosh_e0c1de(); + return; +} + +kernel void compute_main() { + cosh_e0c1de(); + return; +} + diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm new file mode 100644 index 0000000000..17ecea6114 --- /dev/null +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cosh_e0c1de "cosh_e0c1de" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%cosh_e0c1de = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Cosh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cosh_e0c1de + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cosh_e0c1de + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cosh_e0c1de + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl new file mode 100644 index 0000000000..bb74a3776b --- /dev/null +++ b/test/intrinsics/gen/cosh/e0c1de.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cosh_e0c1de() { + var res : vec4 = cosh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + cosh_e0c1de(); +} + +[[stage(fragment)]] +fn fragment_main() { + cosh_e0c1de(); +} + +[[stage(compute)]] +fn compute_main() { + cosh_e0c1de(); +} diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl new file mode 100644 index 0000000000..7dc18e7832 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_0d0e46() { + var res: vec4 = countOneBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_0d0e46(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_0d0e46(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_0d0e46(); +} diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl new file mode 100644 index 0000000000..dcb86cdf59 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_0d0e46() { + uint4 res = countbits(uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + countOneBits_0d0e46(); + return; +} + +void fragment_main() { + countOneBits_0d0e46(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_0d0e46(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl new file mode 100644 index 0000000000..54b1390c31 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_0d0e46() { + uint4 res = popcount(uint4()); +} + +vertex void vertex_main() { + countOneBits_0d0e46(); + return; +} + +fragment void fragment_main() { + countOneBits_0d0e46(); + return; +} + +kernel void compute_main() { + countOneBits_0d0e46(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm new file mode 100644 index 0000000000..e17d9f3254 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_0d0e46 "countOneBits_0d0e46" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %12 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 +%countOneBits_0d0e46 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %12 + %9 = OpBitCount %v4uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_0d0e46 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_0d0e46 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_0d0e46 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl new file mode 100644 index 0000000000..561970b88a --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0d0e46.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_0d0e46() { + var res : vec4 = countOneBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_0d0e46(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_0d0e46(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_0d0e46(); +} diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl new file mode 100644 index 0000000000..6ffa27dbc7 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_0f7980() { + var res: vec4 = countOneBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_0f7980(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_0f7980(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_0f7980(); +} diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl new file mode 100644 index 0000000000..1c0cab492c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_0f7980() { + int4 res = countbits(int4(0, 0, 0, 0)); +} + +void vertex_main() { + countOneBits_0f7980(); + return; +} + +void fragment_main() { + countOneBits_0f7980(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_0f7980(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl new file mode 100644 index 0000000000..2f2970783a --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_0f7980() { + int4 res = popcount(int4()); +} + +vertex void vertex_main() { + countOneBits_0f7980(); + return; +} + +fragment void fragment_main() { + countOneBits_0f7980(); + return; +} + +kernel void compute_main() { + countOneBits_0f7980(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm new file mode 100644 index 0000000000..e20c852fb1 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_0f7980 "countOneBits_0f7980" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %12 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 +%countOneBits_0f7980 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %12 + %9 = OpBitCount %v4int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_0f7980 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_0f7980 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_0f7980 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl new file mode 100644 index 0000000000..79e258292c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/0f7980.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_0f7980() { + var res : vec4 = countOneBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_0f7980(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_0f7980(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_0f7980(); +} diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl new file mode 100644 index 0000000000..3c07f8acd7 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_65d2ae() { + var res: vec3 = countOneBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_65d2ae(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_65d2ae(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_65d2ae(); +} diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl new file mode 100644 index 0000000000..1158671f0f --- /dev/null +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_65d2ae() { + int3 res = countbits(int3(0, 0, 0)); +} + +void vertex_main() { + countOneBits_65d2ae(); + return; +} + +void fragment_main() { + countOneBits_65d2ae(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_65d2ae(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl new file mode 100644 index 0000000000..1cf0ffd232 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_65d2ae() { + int3 res = popcount(int3()); +} + +vertex void vertex_main() { + countOneBits_65d2ae(); + return; +} + +fragment void fragment_main() { + countOneBits_65d2ae(); + return; +} + +kernel void compute_main() { + countOneBits_65d2ae(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm new file mode 100644 index 0000000000..57a52f386e --- /dev/null +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_65d2ae "countOneBits_65d2ae" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %12 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 +%countOneBits_65d2ae = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %12 + %9 = OpBitCount %v3int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_65d2ae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_65d2ae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_65d2ae + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl new file mode 100644 index 0000000000..209dc7a87c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/65d2ae.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_65d2ae() { + var res : vec3 = countOneBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_65d2ae(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_65d2ae(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_65d2ae(); +} diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl new file mode 100644 index 0000000000..f96143b2fa --- /dev/null +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_690cfc() { + var res: vec3 = countOneBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_690cfc(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_690cfc(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_690cfc(); +} diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl new file mode 100644 index 0000000000..be66422f12 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_690cfc() { + uint3 res = countbits(uint3(0u, 0u, 0u)); +} + +void vertex_main() { + countOneBits_690cfc(); + return; +} + +void fragment_main() { + countOneBits_690cfc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_690cfc(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl new file mode 100644 index 0000000000..fe38cf575a --- /dev/null +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_690cfc() { + uint3 res = popcount(uint3()); +} + +vertex void vertex_main() { + countOneBits_690cfc(); + return; +} + +fragment void fragment_main() { + countOneBits_690cfc(); + return; +} + +kernel void compute_main() { + countOneBits_690cfc(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm new file mode 100644 index 0000000000..011e90326b --- /dev/null +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_690cfc "countOneBits_690cfc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %12 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 +%countOneBits_690cfc = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %12 + %9 = OpBitCount %v3uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_690cfc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_690cfc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_690cfc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl new file mode 100644 index 0000000000..3ac5ddb445 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/690cfc.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_690cfc() { + var res : vec3 = countOneBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_690cfc(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_690cfc(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_690cfc(); +} diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl new file mode 100644 index 0000000000..368f3ea3c8 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_94fd81() { + var res: vec2 = countOneBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_94fd81(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_94fd81(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_94fd81(); +} diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl new file mode 100644 index 0000000000..547cdadbc8 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_94fd81() { + uint2 res = countbits(uint2(0u, 0u)); +} + +void vertex_main() { + countOneBits_94fd81(); + return; +} + +void fragment_main() { + countOneBits_94fd81(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_94fd81(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl new file mode 100644 index 0000000000..8f12412e29 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_94fd81() { + uint2 res = popcount(uint2()); +} + +vertex void vertex_main() { + countOneBits_94fd81(); + return; +} + +fragment void fragment_main() { + countOneBits_94fd81(); + return; +} + +kernel void compute_main() { + countOneBits_94fd81(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm new file mode 100644 index 0000000000..d3886508ef --- /dev/null +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_94fd81 "countOneBits_94fd81" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %12 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 +%countOneBits_94fd81 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %12 + %9 = OpBitCount %v2uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_94fd81 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_94fd81 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_94fd81 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl new file mode 100644 index 0000000000..69fa22d55c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/94fd81.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_94fd81() { + var res : vec2 = countOneBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_94fd81(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_94fd81(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_94fd81(); +} diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl new file mode 100644 index 0000000000..ab447cafe6 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_ae44f9() { + var res: u32 = countOneBits(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_ae44f9(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_ae44f9(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_ae44f9(); +} diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl new file mode 100644 index 0000000000..a9eebc6fde --- /dev/null +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_ae44f9() { + uint res = countbits(1u); +} + +void vertex_main() { + countOneBits_ae44f9(); + return; +} + +void fragment_main() { + countOneBits_ae44f9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_ae44f9(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl new file mode 100644 index 0000000000..4313675e1c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_ae44f9() { + uint res = popcount(1u); +} + +vertex void vertex_main() { + countOneBits_ae44f9(); + return; +} + +fragment void fragment_main() { + countOneBits_ae44f9(); + return; +} + +kernel void compute_main() { + countOneBits_ae44f9(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm new file mode 100644 index 0000000000..70edbdf1e8 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_ae44f9 "countOneBits_ae44f9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %14 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%countOneBits_ae44f9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %14 + %9 = OpBitCount %uint %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_ae44f9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_ae44f9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_ae44f9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl new file mode 100644 index 0000000000..323ceab08b --- /dev/null +++ b/test/intrinsics/gen/countOneBits/ae44f9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_ae44f9() { + var res : u32 = countOneBits(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_ae44f9(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_ae44f9(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_ae44f9(); +} diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl new file mode 100644 index 0000000000..d6afd811b3 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_af90e2() { + var res: vec2 = countOneBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_af90e2(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_af90e2(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_af90e2(); +} diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl new file mode 100644 index 0000000000..a3c0bca90c --- /dev/null +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_af90e2() { + int2 res = countbits(int2(0, 0)); +} + +void vertex_main() { + countOneBits_af90e2(); + return; +} + +void fragment_main() { + countOneBits_af90e2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_af90e2(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl new file mode 100644 index 0000000000..0c0e24b948 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_af90e2() { + int2 res = popcount(int2()); +} + +vertex void vertex_main() { + countOneBits_af90e2(); + return; +} + +fragment void fragment_main() { + countOneBits_af90e2(); + return; +} + +kernel void compute_main() { + countOneBits_af90e2(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm new file mode 100644 index 0000000000..1f79a2a35b --- /dev/null +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_af90e2 "countOneBits_af90e2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %12 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 +%countOneBits_af90e2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %12 + %9 = OpBitCount %v2int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_af90e2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_af90e2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_af90e2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl new file mode 100644 index 0000000000..1f7759dc58 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/af90e2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_af90e2() { + var res : vec2 = countOneBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_af90e2(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_af90e2(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_af90e2(); +} diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl new file mode 100644 index 0000000000..c271a37c9d --- /dev/null +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn countOneBits_fd88b2() { + var res: i32 = countOneBits(1); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_fd88b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_fd88b2(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_fd88b2(); +} diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl new file mode 100644 index 0000000000..be5f7782de --- /dev/null +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void countOneBits_fd88b2() { + int res = countbits(1); +} + +void vertex_main() { + countOneBits_fd88b2(); + return; +} + +void fragment_main() { + countOneBits_fd88b2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + countOneBits_fd88b2(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl new file mode 100644 index 0000000000..87cbb5c4b5 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void countOneBits_fd88b2() { + int res = popcount(1); +} + +vertex void vertex_main() { + countOneBits_fd88b2(); + return; +} + +fragment void fragment_main() { + countOneBits_fd88b2(); + return; +} + +kernel void compute_main() { + countOneBits_fd88b2(); + return; +} + diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm new file mode 100644 index 0000000000..32fdbfe346 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %countOneBits_fd88b2 "countOneBits_fd88b2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %14 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%countOneBits_fd88b2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %14 + %9 = OpBitCount %int %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %countOneBits_fd88b2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %countOneBits_fd88b2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %countOneBits_fd88b2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl new file mode 100644 index 0000000000..9e6e9e80e1 --- /dev/null +++ b/test/intrinsics/gen/countOneBits/fd88b2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn countOneBits_fd88b2() { + var res : i32 = countOneBits(1); +} + +[[stage(vertex)]] +fn vertex_main() { + countOneBits_fd88b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + countOneBits_fd88b2(); +} + +[[stage(compute)]] +fn compute_main() { + countOneBits_fd88b2(); +} diff --git a/test/intrinsics/gen/cross/041cb0.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl new file mode 100644 index 0000000000..e2f5ddd424 --- /dev/null +++ b/test/intrinsics/gen/cross/041cb0.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn cross_041cb0() { + var res: vec3 = cross(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cross_041cb0(); +} + +[[stage(fragment)]] +fn fragment_main() { + cross_041cb0(); +} + +[[stage(compute)]] +fn compute_main() { + cross_041cb0(); +} diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl new file mode 100644 index 0000000000..59be0e9f70 --- /dev/null +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void cross_041cb0() { + float3 res = cross(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + cross_041cb0(); + return; +} + +void fragment_main() { + cross_041cb0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + cross_041cb0(); + return; +} + diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl new file mode 100644 index 0000000000..fc8f3119f1 --- /dev/null +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void cross_041cb0() { + float3 res = cross(float3(), float3()); +} + +vertex void vertex_main() { + cross_041cb0(); + return; +} + +fragment void fragment_main() { + cross_041cb0(); + return; +} + +kernel void compute_main() { + cross_041cb0(); + return; +} + diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm new file mode 100644 index 0000000000..e14592e1ba --- /dev/null +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %cross_041cb0 "cross_041cb0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%cross_041cb0 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Cross %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %cross_041cb0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %cross_041cb0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %cross_041cb0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl new file mode 100644 index 0000000000..ef4b20ff29 --- /dev/null +++ b/test/intrinsics/gen/cross/041cb0.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn cross_041cb0() { + var res : vec3 = cross(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + cross_041cb0(); +} + +[[stage(fragment)]] +fn fragment_main() { + cross_041cb0(); +} + +[[stage(compute)]] +fn compute_main() { + cross_041cb0(); +} diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl new file mode 100644 index 0000000000..1b4b85defb --- /dev/null +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn determinant_2b62ba() { + var res: f32 = determinant(mat3x3()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_2b62ba(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_2b62ba(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_2b62ba(); +} diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl new file mode 100644 index 0000000000..45e0cf8829 --- /dev/null +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void determinant_2b62ba() { + float res = determinant(float3x3(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + determinant_2b62ba(); + return; +} + +void fragment_main() { + determinant_2b62ba(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + determinant_2b62ba(); + return; +} + diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl new file mode 100644 index 0000000000..22bfd581bc --- /dev/null +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void determinant_2b62ba() { + float res = determinant(float3x3()); +} + +vertex void vertex_main() { + determinant_2b62ba(); + return; +} + +fragment void fragment_main() { + determinant_2b62ba(); + return; +} + +kernel void compute_main() { + determinant_2b62ba(); + return; +} + diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm new file mode 100644 index 0000000000..763032a7fa --- /dev/null +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %determinant_2b62ba "determinant_2b62ba" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 +%mat3v3float = OpTypeMatrix %v3float 3 + %13 = OpConstantNull %mat3v3float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%determinant_2b62ba = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Determinant %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %determinant_2b62ba + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %determinant_2b62ba + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %determinant_2b62ba + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl new file mode 100644 index 0000000000..0c79f281ae --- /dev/null +++ b/test/intrinsics/gen/determinant/2b62ba.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn determinant_2b62ba() { + var res : f32 = determinant(mat3x3()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_2b62ba(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_2b62ba(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_2b62ba(); +} diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl new file mode 100644 index 0000000000..d4d4a1164e --- /dev/null +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn determinant_a0a87c() { + var res: f32 = determinant(mat4x4()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_a0a87c(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_a0a87c(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_a0a87c(); +} diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl new file mode 100644 index 0000000000..83bb75133c --- /dev/null +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void determinant_a0a87c() { + float res = determinant(float4x4(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + determinant_a0a87c(); + return; +} + +void fragment_main() { + determinant_a0a87c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + determinant_a0a87c(); + return; +} + diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl new file mode 100644 index 0000000000..0d17e9c4a6 --- /dev/null +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void determinant_a0a87c() { + float res = determinant(float4x4()); +} + +vertex void vertex_main() { + determinant_a0a87c(); + return; +} + +fragment void fragment_main() { + determinant_a0a87c(); + return; +} + +kernel void compute_main() { + determinant_a0a87c(); + return; +} + diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm new file mode 100644 index 0000000000..44b6875a1d --- /dev/null +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %determinant_a0a87c "determinant_a0a87c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 +%mat4v4float = OpTypeMatrix %v4float 4 + %13 = OpConstantNull %mat4v4float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%determinant_a0a87c = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Determinant %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %determinant_a0a87c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %determinant_a0a87c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %determinant_a0a87c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl new file mode 100644 index 0000000000..402650feea --- /dev/null +++ b/test/intrinsics/gen/determinant/a0a87c.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn determinant_a0a87c() { + var res : f32 = determinant(mat4x4()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_a0a87c(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_a0a87c(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_a0a87c(); +} diff --git a/test/intrinsics/gen/determinant/e19305.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl new file mode 100644 index 0000000000..96a1fe0aa1 --- /dev/null +++ b/test/intrinsics/gen/determinant/e19305.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn determinant_e19305() { + var res: f32 = determinant(mat2x2()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_e19305(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_e19305(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_e19305(); +} diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl new file mode 100644 index 0000000000..90295a3bdf --- /dev/null +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void determinant_e19305() { + float res = determinant(float2x2(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + determinant_e19305(); + return; +} + +void fragment_main() { + determinant_e19305(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + determinant_e19305(); + return; +} + diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl new file mode 100644 index 0000000000..22919d40ed --- /dev/null +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void determinant_e19305() { + float res = determinant(float2x2()); +} + +vertex void vertex_main() { + determinant_e19305(); + return; +} + +fragment void fragment_main() { + determinant_e19305(); + return; +} + +kernel void compute_main() { + determinant_e19305(); + return; +} + diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm new file mode 100644 index 0000000000..80a1dedfcc --- /dev/null +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %determinant_e19305 "determinant_e19305" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 +%mat2v2float = OpTypeMatrix %v2float 2 + %13 = OpConstantNull %mat2v2float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%determinant_e19305 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Determinant %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %determinant_e19305 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %determinant_e19305 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %determinant_e19305 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl new file mode 100644 index 0000000000..f5cbf338f2 --- /dev/null +++ b/test/intrinsics/gen/determinant/e19305.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn determinant_e19305() { + var res : f32 = determinant(mat2x2()); +} + +[[stage(vertex)]] +fn vertex_main() { + determinant_e19305(); +} + +[[stage(fragment)]] +fn fragment_main() { + determinant_e19305(); +} + +[[stage(compute)]] +fn compute_main() { + determinant_e19305(); +} diff --git a/test/intrinsics/gen/distance/0657d4.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl new file mode 100644 index 0000000000..065497d4ca --- /dev/null +++ b/test/intrinsics/gen/distance/0657d4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn distance_0657d4() { + var res: f32 = distance(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_0657d4(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_0657d4(); +} + +[[stage(compute)]] +fn compute_main() { + distance_0657d4(); +} diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl new file mode 100644 index 0000000000..3237591c55 --- /dev/null +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void distance_0657d4() { + float res = distance(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + distance_0657d4(); + return; +} + +void fragment_main() { + distance_0657d4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + distance_0657d4(); + return; +} + diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl new file mode 100644 index 0000000000..5281fa5d9a --- /dev/null +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void distance_0657d4() { + float res = distance(float3(), float3()); +} + +vertex void vertex_main() { + distance_0657d4(); + return; +} + +fragment void fragment_main() { + distance_0657d4(); + return; +} + +kernel void compute_main() { + distance_0657d4(); + return; +} + diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm new file mode 100644 index 0000000000..510e6bbea7 --- /dev/null +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %distance_0657d4 "distance_0657d4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%distance_0657d4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Distance %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %distance_0657d4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %distance_0657d4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %distance_0657d4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl new file mode 100644 index 0000000000..314378f54c --- /dev/null +++ b/test/intrinsics/gen/distance/0657d4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn distance_0657d4() { + var res : f32 = distance(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_0657d4(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_0657d4(); +} + +[[stage(compute)]] +fn compute_main() { + distance_0657d4(); +} diff --git a/test/intrinsics/gen/distance/9646ea.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl new file mode 100644 index 0000000000..9f4e7b19dd --- /dev/null +++ b/test/intrinsics/gen/distance/9646ea.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn distance_9646ea() { + var res: f32 = distance(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_9646ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_9646ea(); +} + +[[stage(compute)]] +fn compute_main() { + distance_9646ea(); +} diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl new file mode 100644 index 0000000000..f87319508d --- /dev/null +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void distance_9646ea() { + float res = distance(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + distance_9646ea(); + return; +} + +void fragment_main() { + distance_9646ea(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + distance_9646ea(); + return; +} + diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl new file mode 100644 index 0000000000..32611cda49 --- /dev/null +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void distance_9646ea() { + float res = distance(float4(), float4()); +} + +vertex void vertex_main() { + distance_9646ea(); + return; +} + +fragment void fragment_main() { + distance_9646ea(); + return; +} + +kernel void compute_main() { + distance_9646ea(); + return; +} + diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm new file mode 100644 index 0000000000..d034af57aa --- /dev/null +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %distance_9646ea "distance_9646ea" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%distance_9646ea = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Distance %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %distance_9646ea + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %distance_9646ea + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %distance_9646ea + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl new file mode 100644 index 0000000000..39fe3d23a4 --- /dev/null +++ b/test/intrinsics/gen/distance/9646ea.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn distance_9646ea() { + var res : f32 = distance(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_9646ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_9646ea(); +} + +[[stage(compute)]] +fn compute_main() { + distance_9646ea(); +} diff --git a/test/intrinsics/gen/distance/aa4055.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl new file mode 100644 index 0000000000..8e8387a245 --- /dev/null +++ b/test/intrinsics/gen/distance/aa4055.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn distance_aa4055() { + var res: f32 = distance(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_aa4055(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_aa4055(); +} + +[[stage(compute)]] +fn compute_main() { + distance_aa4055(); +} diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl new file mode 100644 index 0000000000..3f7e5a8666 --- /dev/null +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void distance_aa4055() { + float res = distance(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + distance_aa4055(); + return; +} + +void fragment_main() { + distance_aa4055(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + distance_aa4055(); + return; +} + diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl new file mode 100644 index 0000000000..5f2f493c41 --- /dev/null +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void distance_aa4055() { + float res = distance(float2(), float2()); +} + +vertex void vertex_main() { + distance_aa4055(); + return; +} + +fragment void fragment_main() { + distance_aa4055(); + return; +} + +kernel void compute_main() { + distance_aa4055(); + return; +} + diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm new file mode 100644 index 0000000000..52ff97c5a4 --- /dev/null +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %distance_aa4055 "distance_aa4055" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%distance_aa4055 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Distance %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %distance_aa4055 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %distance_aa4055 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %distance_aa4055 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl new file mode 100644 index 0000000000..f6f6826461 --- /dev/null +++ b/test/intrinsics/gen/distance/aa4055.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn distance_aa4055() { + var res : f32 = distance(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_aa4055(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_aa4055(); +} + +[[stage(compute)]] +fn compute_main() { + distance_aa4055(); +} diff --git a/test/intrinsics/gen/distance/cfed73.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl new file mode 100644 index 0000000000..5fe662a56d --- /dev/null +++ b/test/intrinsics/gen/distance/cfed73.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn distance_cfed73() { + var res: f32 = distance(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_cfed73(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_cfed73(); +} + +[[stage(compute)]] +fn compute_main() { + distance_cfed73(); +} diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl new file mode 100644 index 0000000000..7a90d5402f --- /dev/null +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void distance_cfed73() { + float res = distance(1.0f, 1.0f); +} + +void vertex_main() { + distance_cfed73(); + return; +} + +void fragment_main() { + distance_cfed73(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + distance_cfed73(); + return; +} + diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl new file mode 100644 index 0000000000..401e6d81cf --- /dev/null +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.msl @@ -0,0 +1,50 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void distance_cfed73() { + float res = distance(1.0f, 1.0f); +} + +vertex void vertex_main() { + distance_cfed73(); + return; +} + +fragment void fragment_main() { + distance_cfed73(); + return; +} + +kernel void compute_main() { + distance_cfed73(); + return; +} + + +tint_1oo4q6.metal:5:17: error: call to 'distance' is ambiguous + float res = distance(1.0f, 1.0f); + ^~~~~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:303:17: note: candidate function +METAL_FUNC half distance(half2 x, half2 y) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:334:17: note: candidate function +METAL_FUNC half distance(half3 x, half3 y) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:365:17: note: candidate function +METAL_FUNC half distance(half4 x, half4 y) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:404:18: note: candidate function +METAL_FUNC float distance(float2 x, float2 y) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:447:18: note: candidate function +METAL_FUNC float distance(float3 x, float3 y) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:490:18: note: candidate function +METAL_FUNC float distance(float4 x, float4 y) + ^ +1 error generated. diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm new file mode 100644 index 0000000000..29c44fb760 --- /dev/null +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %distance_cfed73 "distance_cfed73" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%distance_cfed73 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Distance %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %distance_cfed73 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %distance_cfed73 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %distance_cfed73 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl new file mode 100644 index 0000000000..ff76b9d7cc --- /dev/null +++ b/test/intrinsics/gen/distance/cfed73.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn distance_cfed73() { + var res : f32 = distance(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + distance_cfed73(); +} + +[[stage(fragment)]] +fn fragment_main() { + distance_cfed73(); +} + +[[stage(compute)]] +fn compute_main() { + distance_cfed73(); +} diff --git a/test/intrinsics/gen/dot/0c577b.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl new file mode 100644 index 0000000000..7d32e31549 --- /dev/null +++ b/test/intrinsics/gen/dot/0c577b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dot_0c577b() { + var res: f32 = dot(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_0c577b(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_0c577b(); +} + +[[stage(compute)]] +fn compute_main() { + dot_0c577b(); +} diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl new file mode 100644 index 0000000000..2736edd301 --- /dev/null +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void dot_0c577b() { + float res = dot(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + dot_0c577b(); + return; +} + +void fragment_main() { + dot_0c577b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + dot_0c577b(); + return; +} + diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl new file mode 100644 index 0000000000..3758c7f562 --- /dev/null +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void dot_0c577b() { + float res = dot(float4(), float4()); +} + +vertex void vertex_main() { + dot_0c577b(); + return; +} + +fragment void fragment_main() { + dot_0c577b(); + return; +} + +kernel void compute_main() { + dot_0c577b(); + return; +} + diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm new file mode 100644 index 0000000000..37383ec6af --- /dev/null +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %dot_0c577b "dot_0c577b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %11 = OpConstantNull %v4float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %dot_0c577b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpDot %float %11 %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %dot_0c577b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %dot_0c577b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %dot_0c577b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl new file mode 100644 index 0000000000..09912d6b7d --- /dev/null +++ b/test/intrinsics/gen/dot/0c577b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn dot_0c577b() { + var res : f32 = dot(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_0c577b(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_0c577b(); +} + +[[stage(compute)]] +fn compute_main() { + dot_0c577b(); +} diff --git a/test/intrinsics/gen/dot/883f0e.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl new file mode 100644 index 0000000000..74c9ab77fd --- /dev/null +++ b/test/intrinsics/gen/dot/883f0e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dot_883f0e() { + var res: f32 = dot(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_883f0e(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_883f0e(); +} + +[[stage(compute)]] +fn compute_main() { + dot_883f0e(); +} diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl new file mode 100644 index 0000000000..c72475a4cb --- /dev/null +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void dot_883f0e() { + float res = dot(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + dot_883f0e(); + return; +} + +void fragment_main() { + dot_883f0e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + dot_883f0e(); + return; +} + diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl new file mode 100644 index 0000000000..260fee30e4 --- /dev/null +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void dot_883f0e() { + float res = dot(float2(), float2()); +} + +vertex void vertex_main() { + dot_883f0e(); + return; +} + +fragment void fragment_main() { + dot_883f0e(); + return; +} + +kernel void compute_main() { + dot_883f0e(); + return; +} + diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm new file mode 100644 index 0000000000..7f313bfb0d --- /dev/null +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %dot_883f0e "dot_883f0e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %11 = OpConstantNull %v2float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %dot_883f0e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpDot %float %11 %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %dot_883f0e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %dot_883f0e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %dot_883f0e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl new file mode 100644 index 0000000000..e0cfc7344d --- /dev/null +++ b/test/intrinsics/gen/dot/883f0e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn dot_883f0e() { + var res : f32 = dot(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_883f0e(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_883f0e(); +} + +[[stage(compute)]] +fn compute_main() { + dot_883f0e(); +} diff --git a/test/intrinsics/gen/dot/ba4246.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl new file mode 100644 index 0000000000..11776b9acd --- /dev/null +++ b/test/intrinsics/gen/dot/ba4246.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dot_ba4246() { + var res: f32 = dot(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_ba4246(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_ba4246(); +} + +[[stage(compute)]] +fn compute_main() { + dot_ba4246(); +} diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl new file mode 100644 index 0000000000..aa91fe7b4e --- /dev/null +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void dot_ba4246() { + float res = dot(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + dot_ba4246(); + return; +} + +void fragment_main() { + dot_ba4246(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + dot_ba4246(); + return; +} + diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl new file mode 100644 index 0000000000..521557f3ac --- /dev/null +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void dot_ba4246() { + float res = dot(float3(), float3()); +} + +vertex void vertex_main() { + dot_ba4246(); + return; +} + +fragment void fragment_main() { + dot_ba4246(); + return; +} + +kernel void compute_main() { + dot_ba4246(); + return; +} + diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm new file mode 100644 index 0000000000..613cb9255c --- /dev/null +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %dot_ba4246 "dot_ba4246" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %11 = OpConstantNull %v3float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %dot_ba4246 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpDot %float %11 %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %dot_ba4246 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %dot_ba4246 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %dot_ba4246 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl new file mode 100644 index 0000000000..a17c295fd5 --- /dev/null +++ b/test/intrinsics/gen/dot/ba4246.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn dot_ba4246() { + var res : f32 = dot(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + dot_ba4246(); +} + +[[stage(fragment)]] +fn fragment_main() { + dot_ba4246(); +} + +[[stage(compute)]] +fn compute_main() { + dot_ba4246(); +} diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl b/test/intrinsics/gen/dpdx/0763f7.wgsl new file mode 100644 index 0000000000..69bc43722f --- /dev/null +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdx_0763f7() { + var res: vec3 = dpdx(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_0763f7(); +} diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl new file mode 100644 index 0000000000..1ca6ae7c3a --- /dev/null +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdx_0763f7() { + float3 res = ddx(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdx_0763f7(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl new file mode 100644 index 0000000000..082d92434f --- /dev/null +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdx_0763f7() { + float3 res = dfdx(float3()); +} + +fragment void fragment_main() { + dpdx_0763f7(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm new file mode 100644 index 0000000000..4a1bd28b90 --- /dev/null +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdx_0763f7 "dpdx_0763f7" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdx_0763f7 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdx %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdx_0763f7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl new file mode 100644 index 0000000000..be5f4e0bb4 --- /dev/null +++ b/test/intrinsics/gen/dpdx/0763f7.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdx_0763f7() { + var res : vec3 = dpdx(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_0763f7(); +} diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl b/test/intrinsics/gen/dpdx/99edb1.wgsl new file mode 100644 index 0000000000..552e889f34 --- /dev/null +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdx_99edb1() { + var res: vec2 = dpdx(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_99edb1(); +} diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl new file mode 100644 index 0000000000..c692e0930c --- /dev/null +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdx_99edb1() { + float2 res = ddx(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdx_99edb1(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl new file mode 100644 index 0000000000..1c389c89ea --- /dev/null +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdx_99edb1() { + float2 res = dfdx(float2()); +} + +fragment void fragment_main() { + dpdx_99edb1(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm new file mode 100644 index 0000000000..7499b26422 --- /dev/null +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdx_99edb1 "dpdx_99edb1" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdx_99edb1 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdx %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdx_99edb1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl new file mode 100644 index 0000000000..aafee00f68 --- /dev/null +++ b/test/intrinsics/gen/dpdx/99edb1.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdx_99edb1() { + var res : vec2 = dpdx(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_99edb1(); +} diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl b/test/intrinsics/gen/dpdx/c487fa.wgsl new file mode 100644 index 0000000000..863b95d2a7 --- /dev/null +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdx_c487fa() { + var res: vec4 = dpdx(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_c487fa(); +} diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl new file mode 100644 index 0000000000..4b78e5b3c2 --- /dev/null +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdx_c487fa() { + float4 res = ddx(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdx_c487fa(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl new file mode 100644 index 0000000000..06e584f6f3 --- /dev/null +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdx_c487fa() { + float4 res = dfdx(float4()); +} + +fragment void fragment_main() { + dpdx_c487fa(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm new file mode 100644 index 0000000000..3065b31241 --- /dev/null +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdx_c487fa "dpdx_c487fa" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdx_c487fa = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdx %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdx_c487fa + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl new file mode 100644 index 0000000000..350f0c2676 --- /dev/null +++ b/test/intrinsics/gen/dpdx/c487fa.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdx_c487fa() { + var res : vec4 = dpdx(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_c487fa(); +} diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl b/test/intrinsics/gen/dpdx/e263de.wgsl new file mode 100644 index 0000000000..5317a569ad --- /dev/null +++ b/test/intrinsics/gen/dpdx/e263de.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdx_e263de() { + var res: f32 = dpdx(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_e263de(); +} diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl new file mode 100644 index 0000000000..7aced4b86f --- /dev/null +++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdx_e263de() { + float res = ddx(1.0f); +} + +void fragment_main() { + dpdx_e263de(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl new file mode 100644 index 0000000000..9a63d081ba --- /dev/null +++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdx_e263de() { + float res = dfdx(1.0f); +} + +fragment void fragment_main() { + dpdx_e263de(); + return; +} + diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm new file mode 100644 index 0000000000..362c4c1b6b --- /dev/null +++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdx_e263de "dpdx_e263de" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdx_e263de = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdx %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdx_e263de + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl new file mode 100644 index 0000000000..03939a66fd --- /dev/null +++ b/test/intrinsics/gen/dpdx/e263de.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdx_e263de() { + var res : f32 = dpdx(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdx_e263de(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl new file mode 100644 index 0000000000..cdaec0c2b0 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxCoarse_029152() { + var res: f32 = dpdxCoarse(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_029152(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl new file mode 100644 index 0000000000..74a2823787 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxCoarse_029152() { + float res = ddx_coarse(1.0f); +} + +void fragment_main() { + dpdxCoarse_029152(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl new file mode 100644 index 0000000000..fc27f74156 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxCoarse_029152() { + float res = dfdx(1.0f); +} + +fragment void fragment_main() { + dpdxCoarse_029152(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm new file mode 100644 index 0000000000..a000ab174d --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxCoarse_029152 "dpdxCoarse_029152" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdxCoarse_029152 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdxCoarse %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxCoarse_029152 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl new file mode 100644 index 0000000000..9f2d250e7b --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/029152.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxCoarse_029152() { + var res : f32 = dpdxCoarse(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_029152(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl new file mode 100644 index 0000000000..f0c72c012a --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxCoarse_9581cf() { + var res: vec2 = dpdxCoarse(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_9581cf(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl new file mode 100644 index 0000000000..dabf49e61b --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxCoarse_9581cf() { + float2 res = ddx_coarse(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdxCoarse_9581cf(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl new file mode 100644 index 0000000000..283a082626 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxCoarse_9581cf() { + float2 res = dfdx(float2()); +} + +fragment void fragment_main() { + dpdxCoarse_9581cf(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm new file mode 100644 index 0000000000..8113530178 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxCoarse_9581cf "dpdxCoarse_9581cf" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdxCoarse_9581cf = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdxCoarse %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxCoarse_9581cf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl new file mode 100644 index 0000000000..a34115036d --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/9581cf.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxCoarse_9581cf() { + var res : vec2 = dpdxCoarse(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_9581cf(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl new file mode 100644 index 0000000000..3a3991135e --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxCoarse_c28641() { + var res: vec4 = dpdxCoarse(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_c28641(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl new file mode 100644 index 0000000000..8ad91d2d29 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxCoarse_c28641() { + float4 res = ddx_coarse(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdxCoarse_c28641(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl new file mode 100644 index 0000000000..7134062edf --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxCoarse_c28641() { + float4 res = dfdx(float4()); +} + +fragment void fragment_main() { + dpdxCoarse_c28641(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm new file mode 100644 index 0000000000..fbf633711a --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxCoarse_c28641 "dpdxCoarse_c28641" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdxCoarse_c28641 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdxCoarse %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxCoarse_c28641 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl new file mode 100644 index 0000000000..17c714b751 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/c28641.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxCoarse_c28641() { + var res : vec4 = dpdxCoarse(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_c28641(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl new file mode 100644 index 0000000000..7cf90a95c5 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxCoarse_f64d7b() { + var res: vec3 = dpdxCoarse(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_f64d7b(); +} diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl new file mode 100644 index 0000000000..e73fe4b373 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxCoarse_f64d7b() { + float3 res = ddx_coarse(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdxCoarse_f64d7b(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl new file mode 100644 index 0000000000..e04364e491 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxCoarse_f64d7b() { + float3 res = dfdx(float3()); +} + +fragment void fragment_main() { + dpdxCoarse_f64d7b(); + return; +} + diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm new file mode 100644 index 0000000000..86b062848d --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxCoarse_f64d7b "dpdxCoarse_f64d7b" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdxCoarse_f64d7b = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdxCoarse %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxCoarse_f64d7b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl new file mode 100644 index 0000000000..6182abec46 --- /dev/null +++ b/test/intrinsics/gen/dpdxCoarse/f64d7b.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxCoarse_f64d7b() { + var res : vec3 = dpdxCoarse(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxCoarse_f64d7b(); +} diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl new file mode 100644 index 0000000000..3230463dce --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxFine_8c5069() { + var res: vec4 = dpdxFine(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_8c5069(); +} diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl new file mode 100644 index 0000000000..28414bb81f --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxFine_8c5069() { + float4 res = ddx_fine(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdxFine_8c5069(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl new file mode 100644 index 0000000000..c4a18edc94 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxFine_8c5069() { + float4 res = dfdx(float4()); +} + +fragment void fragment_main() { + dpdxFine_8c5069(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm new file mode 100644 index 0000000000..318a5cef2a --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxFine_8c5069 "dpdxFine_8c5069" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdxFine_8c5069 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdxFine %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxFine_8c5069 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl new file mode 100644 index 0000000000..a83e763db7 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/8c5069.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxFine_8c5069() { + var res : vec4 = dpdxFine(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_8c5069(); +} diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl new file mode 100644 index 0000000000..3173662f10 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxFine_9631de() { + var res: vec2 = dpdxFine(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_9631de(); +} diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl new file mode 100644 index 0000000000..2aee38d991 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxFine_9631de() { + float2 res = ddx_fine(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdxFine_9631de(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl new file mode 100644 index 0000000000..be6ed51adc --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxFine_9631de() { + float2 res = dfdx(float2()); +} + +fragment void fragment_main() { + dpdxFine_9631de(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm new file mode 100644 index 0000000000..f015eb4e4c --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxFine_9631de "dpdxFine_9631de" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdxFine_9631de = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdxFine %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxFine_9631de + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl new file mode 100644 index 0000000000..002e44e0b8 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/9631de.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxFine_9631de() { + var res : vec2 = dpdxFine(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_9631de(); +} diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl new file mode 100644 index 0000000000..35481d2092 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxFine_f401a2() { + var res: f32 = dpdxFine(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_f401a2(); +} diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl new file mode 100644 index 0000000000..badad66ce5 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxFine_f401a2() { + float res = ddx_fine(1.0f); +} + +void fragment_main() { + dpdxFine_f401a2(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl new file mode 100644 index 0000000000..b618db991d --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxFine_f401a2() { + float res = dfdx(1.0f); +} + +fragment void fragment_main() { + dpdxFine_f401a2(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm new file mode 100644 index 0000000000..24fd6961d4 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxFine_f401a2 "dpdxFine_f401a2" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdxFine_f401a2 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdxFine %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxFine_f401a2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl new file mode 100644 index 0000000000..2790d8d668 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f401a2.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxFine_f401a2() { + var res : f32 = dpdxFine(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_f401a2(); +} diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl new file mode 100644 index 0000000000..36663ae79d --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdxFine_f92fb6() { + var res: vec3 = dpdxFine(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_f92fb6(); +} diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl new file mode 100644 index 0000000000..d8e884079a --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdxFine_f92fb6() { + float3 res = ddx_fine(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdxFine_f92fb6(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl new file mode 100644 index 0000000000..f19db0993c --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdxFine_f92fb6() { + float3 res = dfdx(float3()); +} + +fragment void fragment_main() { + dpdxFine_f92fb6(); + return; +} + diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm new file mode 100644 index 0000000000..cdc8be2ac0 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdxFine_f92fb6 "dpdxFine_f92fb6" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdxFine_f92fb6 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdxFine %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdxFine_f92fb6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl new file mode 100644 index 0000000000..a40c3fb522 --- /dev/null +++ b/test/intrinsics/gen/dpdxFine/f92fb6.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdxFine_f92fb6() { + var res : vec3 = dpdxFine(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdxFine_f92fb6(); +} diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl b/test/intrinsics/gen/dpdy/699a05.wgsl new file mode 100644 index 0000000000..f3279e457c --- /dev/null +++ b/test/intrinsics/gen/dpdy/699a05.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdy_699a05() { + var res: vec4 = dpdy(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_699a05(); +} diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl new file mode 100644 index 0000000000..e1d5f3331d --- /dev/null +++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdy_699a05() { + float4 res = ddy(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdy_699a05(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl new file mode 100644 index 0000000000..9a2a776841 --- /dev/null +++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdy_699a05() { + float4 res = dfdy(float4()); +} + +fragment void fragment_main() { + dpdy_699a05(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm new file mode 100644 index 0000000000..b135d448e3 --- /dev/null +++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdy_699a05 "dpdy_699a05" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdy_699a05 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdy %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdy_699a05 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl new file mode 100644 index 0000000000..5be383d44c --- /dev/null +++ b/test/intrinsics/gen/dpdy/699a05.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdy_699a05() { + var res : vec4 = dpdy(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_699a05(); +} diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl new file mode 100644 index 0000000000..6a61aac32e --- /dev/null +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdy_7f8d84() { + var res: f32 = dpdy(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_7f8d84(); +} diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl new file mode 100644 index 0000000000..2b98417e0b --- /dev/null +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdy_7f8d84() { + float res = ddy(1.0f); +} + +void fragment_main() { + dpdy_7f8d84(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl new file mode 100644 index 0000000000..5efaf9e876 --- /dev/null +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdy_7f8d84() { + float res = dfdy(1.0f); +} + +fragment void fragment_main() { + dpdy_7f8d84(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm new file mode 100644 index 0000000000..92838812d0 --- /dev/null +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdy_7f8d84 "dpdy_7f8d84" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdy_7f8d84 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdy %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdy_7f8d84 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl new file mode 100644 index 0000000000..9d96009fa1 --- /dev/null +++ b/test/intrinsics/gen/dpdy/7f8d84.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdy_7f8d84() { + var res : f32 = dpdy(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_7f8d84(); +} diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl new file mode 100644 index 0000000000..b01eeb17b3 --- /dev/null +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdy_a8b56e() { + var res: vec2 = dpdy(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_a8b56e(); +} diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb8f848f50 --- /dev/null +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdy_a8b56e() { + float2 res = ddy(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdy_a8b56e(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl new file mode 100644 index 0000000000..74fa55114a --- /dev/null +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdy_a8b56e() { + float2 res = dfdy(float2()); +} + +fragment void fragment_main() { + dpdy_a8b56e(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm new file mode 100644 index 0000000000..039cac5948 --- /dev/null +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdy_a8b56e "dpdy_a8b56e" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdy_a8b56e = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdy %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdy_a8b56e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl new file mode 100644 index 0000000000..bfe028f522 --- /dev/null +++ b/test/intrinsics/gen/dpdy/a8b56e.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdy_a8b56e() { + var res : vec2 = dpdy(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_a8b56e(); +} diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl b/test/intrinsics/gen/dpdy/feb40f.wgsl new file mode 100644 index 0000000000..f4c2d0b0f1 --- /dev/null +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdy_feb40f() { + var res: vec3 = dpdy(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_feb40f(); +} diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl new file mode 100644 index 0000000000..be1091cc88 --- /dev/null +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdy_feb40f() { + float3 res = ddy(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdy_feb40f(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl new file mode 100644 index 0000000000..5c4fdf7b86 --- /dev/null +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdy_feb40f() { + float3 res = dfdy(float3()); +} + +fragment void fragment_main() { + dpdy_feb40f(); + return; +} + diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm new file mode 100644 index 0000000000..47765fed1a --- /dev/null +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.spvasm @@ -0,0 +1,30 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdy_feb40f "dpdy_feb40f" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdy_feb40f = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdy %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdy_feb40f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl new file mode 100644 index 0000000000..f75381cb0a --- /dev/null +++ b/test/intrinsics/gen/dpdy/feb40f.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdy_feb40f() { + var res : vec3 = dpdy(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdy_feb40f(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl new file mode 100644 index 0000000000..6ccebcad16 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyCoarse_3e1ab4() { + var res: vec2 = dpdyCoarse(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_3e1ab4(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl new file mode 100644 index 0000000000..ea55628aa4 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyCoarse_3e1ab4() { + float2 res = ddy_coarse(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdyCoarse_3e1ab4(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl new file mode 100644 index 0000000000..55be7be34c --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyCoarse_3e1ab4() { + float2 res = dfdy(float2()); +} + +fragment void fragment_main() { + dpdyCoarse_3e1ab4(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm new file mode 100644 index 0000000000..8a004f95b7 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyCoarse_3e1ab4 "dpdyCoarse_3e1ab4" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdyCoarse_3e1ab4 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdyCoarse %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyCoarse_3e1ab4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl new file mode 100644 index 0000000000..d109629ac9 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/3e1ab4.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyCoarse_3e1ab4() { + var res : vec2 = dpdyCoarse(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_3e1ab4(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl new file mode 100644 index 0000000000..b2e958ca74 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyCoarse_445d24() { + var res: vec4 = dpdyCoarse(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_445d24(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl new file mode 100644 index 0000000000..09f3ea5e43 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyCoarse_445d24() { + float4 res = ddy_coarse(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdyCoarse_445d24(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl new file mode 100644 index 0000000000..32038ddcbe --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyCoarse_445d24() { + float4 res = dfdy(float4()); +} + +fragment void fragment_main() { + dpdyCoarse_445d24(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a04611f17 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyCoarse_445d24 "dpdyCoarse_445d24" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdyCoarse_445d24 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdyCoarse %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyCoarse_445d24 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl new file mode 100644 index 0000000000..c5659f6f28 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/445d24.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyCoarse_445d24() { + var res : vec4 = dpdyCoarse(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_445d24(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl new file mode 100644 index 0000000000..9a9419058d --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyCoarse_870a7e() { + var res: f32 = dpdyCoarse(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_870a7e(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl new file mode 100644 index 0000000000..3d181a4c91 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyCoarse_870a7e() { + float res = ddy_coarse(1.0f); +} + +void fragment_main() { + dpdyCoarse_870a7e(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl new file mode 100644 index 0000000000..42c9c5dc7e --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyCoarse_870a7e() { + float res = dfdy(1.0f); +} + +fragment void fragment_main() { + dpdyCoarse_870a7e(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm new file mode 100644 index 0000000000..81b17f011c --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyCoarse_870a7e "dpdyCoarse_870a7e" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdyCoarse_870a7e = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdyCoarse %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyCoarse_870a7e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl new file mode 100644 index 0000000000..1bf505ffdd --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/870a7e.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyCoarse_870a7e() { + var res : f32 = dpdyCoarse(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_870a7e(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl new file mode 100644 index 0000000000..2791802c64 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyCoarse_ae1873() { + var res: vec3 = dpdyCoarse(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_ae1873(); +} diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl new file mode 100644 index 0000000000..2f6b6ac00a --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyCoarse_ae1873() { + float3 res = ddy_coarse(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdyCoarse_ae1873(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl new file mode 100644 index 0000000000..9f1ea7f7b4 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyCoarse_ae1873() { + float3 res = dfdy(float3()); +} + +fragment void fragment_main() { + dpdyCoarse_ae1873(); + return; +} + diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm new file mode 100644 index 0000000000..f6c84c2c72 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyCoarse_ae1873 "dpdyCoarse_ae1873" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdyCoarse_ae1873 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdyCoarse %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyCoarse_ae1873 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl new file mode 100644 index 0000000000..e625403961 --- /dev/null +++ b/test/intrinsics/gen/dpdyCoarse/ae1873.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyCoarse_ae1873() { + var res : vec3 = dpdyCoarse(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyCoarse_ae1873(); +} diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl new file mode 100644 index 0000000000..9bfe290360 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyFine_1fb7ab() { + var res: vec3 = dpdyFine(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_1fb7ab(); +} diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl new file mode 100644 index 0000000000..e9ea6427df --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyFine_1fb7ab() { + float3 res = ddy_fine(float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdyFine_1fb7ab(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl new file mode 100644 index 0000000000..bc48a42d16 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyFine_1fb7ab() { + float3 res = dfdy(float3()); +} + +fragment void fragment_main() { + dpdyFine_1fb7ab(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm new file mode 100644 index 0000000000..30c1c860fe --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyFine_1fb7ab "dpdyFine_1fb7ab" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v3float = OpTypeVector %float 3 + %8 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float +%dpdyFine_1fb7ab = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %8 + %5 = OpDPdyFine %v3float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyFine_1fb7ab + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl new file mode 100644 index 0000000000..852459c22e --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/1fb7ab.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyFine_1fb7ab() { + var res : vec3 = dpdyFine(vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_1fb7ab(); +} diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl new file mode 100644 index 0000000000..f9e7a69edc --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyFine_6eb673() { + var res: f32 = dpdyFine(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_6eb673(); +} diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl new file mode 100644 index 0000000000..678b56fc31 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyFine_6eb673() { + float res = ddy_fine(1.0f); +} + +void fragment_main() { + dpdyFine_6eb673(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl new file mode 100644 index 0000000000..a30960ec4f --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyFine_6eb673() { + float res = dfdy(1.0f); +} + +fragment void fragment_main() { + dpdyFine_6eb673(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm new file mode 100644 index 0000000000..1656762e54 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyFine_6eb673 "dpdyFine_6eb673" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %10 = OpConstantNull %float +%dpdyFine_6eb673 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_float Function %10 + %5 = OpDPdyFine %float %float_1 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyFine_6eb673 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl new file mode 100644 index 0000000000..60caecd2d1 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/6eb673.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyFine_6eb673() { + var res : f32 = dpdyFine(1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_6eb673(); +} diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl new file mode 100644 index 0000000000..a12eb76a63 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyFine_d0a648() { + var res: vec4 = dpdyFine(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_d0a648(); +} diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl new file mode 100644 index 0000000000..81163cb5d8 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyFine_d0a648() { + float4 res = ddy_fine(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + dpdyFine_d0a648(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl new file mode 100644 index 0000000000..93ecdf6b28 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyFine_d0a648() { + float4 res = dfdy(float4()); +} + +fragment void fragment_main() { + dpdyFine_d0a648(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm new file mode 100644 index 0000000000..16a89278a8 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyFine_d0a648 "dpdyFine_d0a648" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%dpdyFine_d0a648 = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %8 + %5 = OpDPdyFine %v4float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyFine_d0a648 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl new file mode 100644 index 0000000000..160b27b15d --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/d0a648.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyFine_d0a648() { + var res : vec4 = dpdyFine(vec4()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_d0a648(); +} diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl new file mode 100644 index 0000000000..e9a892d0f0 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn dpdyFine_df33aa() { + var res: vec2 = dpdyFine(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_df33aa(); +} diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl new file mode 100644 index 0000000000..62cae741c6 --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.hlsl @@ -0,0 +1,9 @@ +void dpdyFine_df33aa() { + float2 res = ddy_fine(float2(0.0f, 0.0f)); +} + +void fragment_main() { + dpdyFine_df33aa(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl new file mode 100644 index 0000000000..a8dcab854f --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void dpdyFine_df33aa() { + float2 res = dfdy(float2()); +} + +fragment void fragment_main() { + dpdyFine_df33aa(); + return; +} + diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm new file mode 100644 index 0000000000..4d5346efaf --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.spvasm @@ -0,0 +1,31 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 14 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %dpdyFine_df33aa "dpdyFine_df33aa" + OpName %res "res" + OpName %fragment_main "fragment_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v2float = OpTypeVector %float 2 + %8 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float +%dpdyFine_df33aa = OpFunction %void None %1 + %4 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %8 + %5 = OpDPdyFine %v2float %8 + OpStore %res %5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %1 + %12 = OpLabel + %13 = OpFunctionCall %void %dpdyFine_df33aa + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl new file mode 100644 index 0000000000..b541ecf09c --- /dev/null +++ b/test/intrinsics/gen/dpdyFine/df33aa.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn dpdyFine_df33aa() { + var res : vec2 = dpdyFine(vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + dpdyFine_df33aa(); +} diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl new file mode 100644 index 0000000000..a5de8fe5e2 --- /dev/null +++ b/test/intrinsics/gen/exp/0f70eb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp_0f70eb() { + var res: vec4 = exp(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_0f70eb(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_0f70eb(); +} + +[[stage(compute)]] +fn compute_main() { + exp_0f70eb(); +} diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl new file mode 100644 index 0000000000..2739620f7c --- /dev/null +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp_0f70eb() { + float4 res = exp(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + exp_0f70eb(); + return; +} + +void fragment_main() { + exp_0f70eb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp_0f70eb(); + return; +} + diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl new file mode 100644 index 0000000000..f019d60e59 --- /dev/null +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp_0f70eb() { + float4 res = exp(float4()); +} + +vertex void vertex_main() { + exp_0f70eb(); + return; +} + +fragment void fragment_main() { + exp_0f70eb(); + return; +} + +kernel void compute_main() { + exp_0f70eb(); + return; +} + diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm new file mode 100644 index 0000000000..f331531082 --- /dev/null +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp_0f70eb "exp_0f70eb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %exp_0f70eb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Exp %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp_0f70eb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp_0f70eb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp_0f70eb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl new file mode 100644 index 0000000000..fcd1bf3143 --- /dev/null +++ b/test/intrinsics/gen/exp/0f70eb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp_0f70eb() { + var res : vec4 = exp(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_0f70eb(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_0f70eb(); +} + +[[stage(compute)]] +fn compute_main() { + exp_0f70eb(); +} diff --git a/test/intrinsics/gen/exp/1951e7.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl new file mode 100644 index 0000000000..4377980166 --- /dev/null +++ b/test/intrinsics/gen/exp/1951e7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp_1951e7() { + var res: vec2 = exp(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_1951e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_1951e7(); +} + +[[stage(compute)]] +fn compute_main() { + exp_1951e7(); +} diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl new file mode 100644 index 0000000000..a58d3e9e5e --- /dev/null +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp_1951e7() { + float2 res = exp(float2(0.0f, 0.0f)); +} + +void vertex_main() { + exp_1951e7(); + return; +} + +void fragment_main() { + exp_1951e7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp_1951e7(); + return; +} + diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl new file mode 100644 index 0000000000..298ce08cca --- /dev/null +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp_1951e7() { + float2 res = exp(float2()); +} + +vertex void vertex_main() { + exp_1951e7(); + return; +} + +fragment void fragment_main() { + exp_1951e7(); + return; +} + +kernel void compute_main() { + exp_1951e7(); + return; +} + diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm new file mode 100644 index 0000000000..61f4ab3430 --- /dev/null +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp_1951e7 "exp_1951e7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %exp_1951e7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Exp %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp_1951e7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp_1951e7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp_1951e7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl new file mode 100644 index 0000000000..345795124f --- /dev/null +++ b/test/intrinsics/gen/exp/1951e7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp_1951e7() { + var res : vec2 = exp(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_1951e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_1951e7(); +} + +[[stage(compute)]] +fn compute_main() { + exp_1951e7(); +} diff --git a/test/intrinsics/gen/exp/771fd2.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl new file mode 100644 index 0000000000..6138fb48c3 --- /dev/null +++ b/test/intrinsics/gen/exp/771fd2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp_771fd2() { + var res: f32 = exp(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_771fd2(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_771fd2(); +} + +[[stage(compute)]] +fn compute_main() { + exp_771fd2(); +} diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl new file mode 100644 index 0000000000..8c34c09951 --- /dev/null +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp_771fd2() { + float res = exp(1.0f); +} + +void vertex_main() { + exp_771fd2(); + return; +} + +void fragment_main() { + exp_771fd2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp_771fd2(); + return; +} + diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl new file mode 100644 index 0000000000..17e6c84619 --- /dev/null +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp_771fd2() { + float res = exp(1.0f); +} + +vertex void vertex_main() { + exp_771fd2(); + return; +} + +fragment void fragment_main() { + exp_771fd2(); + return; +} + +kernel void compute_main() { + exp_771fd2(); + return; +} + diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm new file mode 100644 index 0000000000..cbfdf1cd5b --- /dev/null +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp_771fd2 "exp_771fd2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %exp_771fd2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Exp %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %exp_771fd2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %exp_771fd2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %exp_771fd2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl new file mode 100644 index 0000000000..ca36b2c8e4 --- /dev/null +++ b/test/intrinsics/gen/exp/771fd2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp_771fd2() { + var res : f32 = exp(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_771fd2(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_771fd2(); +} + +[[stage(compute)]] +fn compute_main() { + exp_771fd2(); +} diff --git a/test/intrinsics/gen/exp/d98450.wgsl b/test/intrinsics/gen/exp/d98450.wgsl new file mode 100644 index 0000000000..754d43a4d3 --- /dev/null +++ b/test/intrinsics/gen/exp/d98450.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp_d98450() { + var res: vec3 = exp(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_d98450(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_d98450(); +} + +[[stage(compute)]] +fn compute_main() { + exp_d98450(); +} diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl new file mode 100644 index 0000000000..1587672746 --- /dev/null +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp_d98450() { + float3 res = exp(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + exp_d98450(); + return; +} + +void fragment_main() { + exp_d98450(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp_d98450(); + return; +} + diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.msl b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl new file mode 100644 index 0000000000..7e0df49deb --- /dev/null +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp_d98450() { + float3 res = exp(float3()); +} + +vertex void vertex_main() { + exp_d98450(); + return; +} + +fragment void fragment_main() { + exp_d98450(); + return; +} + +kernel void compute_main() { + exp_d98450(); + return; +} + diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm new file mode 100644 index 0000000000..45cdde144a --- /dev/null +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp_d98450 "exp_d98450" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %exp_d98450 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Exp %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp_d98450 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp_d98450 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp_d98450 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl new file mode 100644 index 0000000000..342316909e --- /dev/null +++ b/test/intrinsics/gen/exp/d98450.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp_d98450() { + var res : vec3 = exp(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp_d98450(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp_d98450(); +} + +[[stage(compute)]] +fn compute_main() { + exp_d98450(); +} diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl new file mode 100644 index 0000000000..ec8cb20f3d --- /dev/null +++ b/test/intrinsics/gen/exp2/1f8680.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp2_1f8680() { + var res: vec3 = exp2(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_1f8680(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_1f8680(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_1f8680(); +} diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl new file mode 100644 index 0000000000..ca91ba5e57 --- /dev/null +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp2_1f8680() { + float3 res = exp2(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + exp2_1f8680(); + return; +} + +void fragment_main() { + exp2_1f8680(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp2_1f8680(); + return; +} + diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl new file mode 100644 index 0000000000..fb80ff795f --- /dev/null +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp2_1f8680() { + float3 res = exp2(float3()); +} + +vertex void vertex_main() { + exp2_1f8680(); + return; +} + +fragment void fragment_main() { + exp2_1f8680(); + return; +} + +kernel void compute_main() { + exp2_1f8680(); + return; +} + diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm new file mode 100644 index 0000000000..1b944c1103 --- /dev/null +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp2_1f8680 "exp2_1f8680" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%exp2_1f8680 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Exp2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp2_1f8680 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp2_1f8680 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp2_1f8680 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl new file mode 100644 index 0000000000..6d20071af8 --- /dev/null +++ b/test/intrinsics/gen/exp2/1f8680.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp2_1f8680() { + var res : vec3 = exp2(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_1f8680(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_1f8680(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_1f8680(); +} diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl new file mode 100644 index 0000000000..d5e4df5066 --- /dev/null +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp2_a9d0a7() { + var res: vec4 = exp2(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_a9d0a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_a9d0a7(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_a9d0a7(); +} diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl new file mode 100644 index 0000000000..6dfb8b8db7 --- /dev/null +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp2_a9d0a7() { + float4 res = exp2(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + exp2_a9d0a7(); + return; +} + +void fragment_main() { + exp2_a9d0a7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp2_a9d0a7(); + return; +} + diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl new file mode 100644 index 0000000000..f6114d4e58 --- /dev/null +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp2_a9d0a7() { + float4 res = exp2(float4()); +} + +vertex void vertex_main() { + exp2_a9d0a7(); + return; +} + +fragment void fragment_main() { + exp2_a9d0a7(); + return; +} + +kernel void compute_main() { + exp2_a9d0a7(); + return; +} + diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm new file mode 100644 index 0000000000..6360aeadda --- /dev/null +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp2_a9d0a7 "exp2_a9d0a7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%exp2_a9d0a7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Exp2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp2_a9d0a7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp2_a9d0a7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp2_a9d0a7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl new file mode 100644 index 0000000000..415b612987 --- /dev/null +++ b/test/intrinsics/gen/exp2/a9d0a7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp2_a9d0a7() { + var res : vec4 = exp2(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_a9d0a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_a9d0a7(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_a9d0a7(); +} diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl new file mode 100644 index 0000000000..5e5cecb422 --- /dev/null +++ b/test/intrinsics/gen/exp2/d6777c.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp2_d6777c() { + var res: vec2 = exp2(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_d6777c(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_d6777c(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_d6777c(); +} diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl new file mode 100644 index 0000000000..1a7cb5fe5a --- /dev/null +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp2_d6777c() { + float2 res = exp2(float2(0.0f, 0.0f)); +} + +void vertex_main() { + exp2_d6777c(); + return; +} + +void fragment_main() { + exp2_d6777c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp2_d6777c(); + return; +} + diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl new file mode 100644 index 0000000000..48a5a4616f --- /dev/null +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp2_d6777c() { + float2 res = exp2(float2()); +} + +vertex void vertex_main() { + exp2_d6777c(); + return; +} + +fragment void fragment_main() { + exp2_d6777c(); + return; +} + +kernel void compute_main() { + exp2_d6777c(); + return; +} + diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm new file mode 100644 index 0000000000..4667d68ba4 --- /dev/null +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp2_d6777c "exp2_d6777c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%exp2_d6777c = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Exp2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %exp2_d6777c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %exp2_d6777c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %exp2_d6777c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl new file mode 100644 index 0000000000..189d7becc4 --- /dev/null +++ b/test/intrinsics/gen/exp2/d6777c.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp2_d6777c() { + var res : vec2 = exp2(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_d6777c(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_d6777c(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_d6777c(); +} diff --git a/test/intrinsics/gen/exp2/dea523.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl new file mode 100644 index 0000000000..6c0391839a --- /dev/null +++ b/test/intrinsics/gen/exp2/dea523.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn exp2_dea523() { + var res: f32 = exp2(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_dea523(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_dea523(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_dea523(); +} diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl new file mode 100644 index 0000000000..8b75b70f94 --- /dev/null +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void exp2_dea523() { + float res = exp2(1.0f); +} + +void vertex_main() { + exp2_dea523(); + return; +} + +void fragment_main() { + exp2_dea523(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + exp2_dea523(); + return; +} + diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl new file mode 100644 index 0000000000..d18c2ef783 --- /dev/null +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void exp2_dea523() { + float res = exp2(1.0f); +} + +vertex void vertex_main() { + exp2_dea523(); + return; +} + +fragment void fragment_main() { + exp2_dea523(); + return; +} + +kernel void compute_main() { + exp2_dea523(); + return; +} + diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm new file mode 100644 index 0000000000..9ae8c9882c --- /dev/null +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %exp2_dea523 "exp2_dea523" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%exp2_dea523 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Exp2 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %exp2_dea523 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %exp2_dea523 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %exp2_dea523 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl new file mode 100644 index 0000000000..136bc62476 --- /dev/null +++ b/test/intrinsics/gen/exp2/dea523.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn exp2_dea523() { + var res : f32 = exp2(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + exp2_dea523(); +} + +[[stage(fragment)]] +fn fragment_main() { + exp2_dea523(); +} + +[[stage(compute)]] +fn compute_main() { + exp2_dea523(); +} diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl new file mode 100644 index 0000000000..e72c377ea3 --- /dev/null +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn faceForward_5afbd5() { + var res: vec3 = faceForward(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_5afbd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_5afbd5(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_5afbd5(); +} diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl new file mode 100644 index 0000000000..9df71d6af5 --- /dev/null +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void faceForward_5afbd5() { + float3 res = faceforward(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + faceForward_5afbd5(); + return; +} + +void fragment_main() { + faceForward_5afbd5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + faceForward_5afbd5(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl new file mode 100644 index 0000000000..4a95173524 --- /dev/null +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void faceForward_5afbd5() { + float3 res = faceforward(float3(), float3(), float3()); +} + +vertex void vertex_main() { + faceForward_5afbd5(); + return; +} + +fragment void fragment_main() { + faceForward_5afbd5(); + return; +} + +kernel void compute_main() { + faceForward_5afbd5(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm new file mode 100644 index 0000000000..90d4263977 --- /dev/null +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %faceForward_5afbd5 "faceForward_5afbd5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%faceForward_5afbd5 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 FaceForward %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %faceForward_5afbd5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %faceForward_5afbd5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %faceForward_5afbd5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl new file mode 100644 index 0000000000..901d9f3b34 --- /dev/null +++ b/test/intrinsics/gen/faceForward/5afbd5.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn faceForward_5afbd5() { + var res : vec3 = faceForward(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_5afbd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_5afbd5(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_5afbd5(); +} diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl new file mode 100644 index 0000000000..fb7a156c3b --- /dev/null +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn faceForward_b316e5() { + var res: vec4 = faceForward(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_b316e5(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_b316e5(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_b316e5(); +} diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl new file mode 100644 index 0000000000..c02347c31c --- /dev/null +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void faceForward_b316e5() { + float4 res = faceforward(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + faceForward_b316e5(); + return; +} + +void fragment_main() { + faceForward_b316e5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + faceForward_b316e5(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl new file mode 100644 index 0000000000..71972d7839 --- /dev/null +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void faceForward_b316e5() { + float4 res = faceforward(float4(), float4(), float4()); +} + +vertex void vertex_main() { + faceForward_b316e5(); + return; +} + +fragment void fragment_main() { + faceForward_b316e5(); + return; +} + +kernel void compute_main() { + faceForward_b316e5(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm new file mode 100644 index 0000000000..163e751ad1 --- /dev/null +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %faceForward_b316e5 "faceForward_b316e5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%faceForward_b316e5 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 FaceForward %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %faceForward_b316e5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %faceForward_b316e5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %faceForward_b316e5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl new file mode 100644 index 0000000000..904f610330 --- /dev/null +++ b/test/intrinsics/gen/faceForward/b316e5.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn faceForward_b316e5() { + var res : vec4 = faceForward(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_b316e5(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_b316e5(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_b316e5(); +} diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl new file mode 100644 index 0000000000..deb3846408 --- /dev/null +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn faceForward_e6908b() { + var res: vec2 = faceForward(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_e6908b(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_e6908b(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_e6908b(); +} diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl new file mode 100644 index 0000000000..de0f89e956 --- /dev/null +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void faceForward_e6908b() { + float2 res = faceforward(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + faceForward_e6908b(); + return; +} + +void fragment_main() { + faceForward_e6908b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + faceForward_e6908b(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl new file mode 100644 index 0000000000..2cfdf0e12e --- /dev/null +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void faceForward_e6908b() { + float2 res = faceforward(float2(), float2(), float2()); +} + +vertex void vertex_main() { + faceForward_e6908b(); + return; +} + +fragment void fragment_main() { + faceForward_e6908b(); + return; +} + +kernel void compute_main() { + faceForward_e6908b(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm new file mode 100644 index 0000000000..861015d522 --- /dev/null +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %faceForward_e6908b "faceForward_e6908b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%faceForward_e6908b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 FaceForward %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %faceForward_e6908b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %faceForward_e6908b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %faceForward_e6908b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl new file mode 100644 index 0000000000..f232df2727 --- /dev/null +++ b/test/intrinsics/gen/faceForward/e6908b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn faceForward_e6908b() { + var res : vec2 = faceForward(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_e6908b(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_e6908b(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_e6908b(); +} diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl new file mode 100644 index 0000000000..0616792403 --- /dev/null +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn faceForward_fc994b() { + var res: f32 = faceForward(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_fc994b(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_fc994b(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_fc994b(); +} diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl new file mode 100644 index 0000000000..88f13411f9 --- /dev/null +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void faceForward_fc994b() { + float res = faceforward(1.0f, 1.0f, 1.0f); +} + +void vertex_main() { + faceForward_fc994b(); + return; +} + +void fragment_main() { + faceForward_fc994b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + faceForward_fc994b(); + return; +} + diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl new file mode 100644 index 0000000000..660f385748 --- /dev/null +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.msl @@ -0,0 +1,50 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void faceForward_fc994b() { + float res = faceforward(1.0f, 1.0f, 1.0f); +} + +vertex void vertex_main() { + faceForward_fc994b(); + return; +} + +fragment void fragment_main() { + faceForward_fc994b(); + return; +} + +kernel void compute_main() { + faceForward_fc994b(); + return; +} + + +tint_2Q1ua3.metal:5:17: error: call to 'faceforward' is ambiguous + float res = faceforward(1.0f, 1.0f, 1.0f); + ^~~~~~~~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:311:18: note: candidate function +METAL_FUNC half2 faceforward(half2 n, half2 i, half2 nref) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:342:18: note: candidate function +METAL_FUNC half3 faceforward(half3 n, half3 i, half3 nref) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:373:18: note: candidate function +METAL_FUNC half4 faceforward(half4 n, half4 i, half4 nref) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:416:19: note: candidate function +METAL_FUNC float2 faceforward(float2 n, float2 i, float2 nref) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:459:19: note: candidate function +METAL_FUNC float3 faceforward(float3 n, float3 i, float3 nref) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:502:19: note: candidate function +METAL_FUNC float4 faceforward(float4 n, float4 i, float4 nref) + ^ +1 error generated. diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm new file mode 100644 index 0000000000..fc9853e057 --- /dev/null +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %faceForward_fc994b "faceForward_fc994b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%faceForward_fc994b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 FaceForward %float_1 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %faceForward_fc994b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %faceForward_fc994b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %faceForward_fc994b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl new file mode 100644 index 0000000000..3dc67f306d --- /dev/null +++ b/test/intrinsics/gen/faceForward/fc994b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn faceForward_fc994b() { + var res : f32 = faceForward(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + faceForward_fc994b(); +} + +[[stage(fragment)]] +fn fragment_main() { + faceForward_fc994b(); +} + +[[stage(compute)]] +fn compute_main() { + faceForward_fc994b(); +} diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl new file mode 100644 index 0000000000..c5a4e525bd --- /dev/null +++ b/test/intrinsics/gen/floor/3bccc4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn floor_3bccc4() { + var res: vec4 = floor(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_3bccc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_3bccc4(); +} + +[[stage(compute)]] +fn compute_main() { + floor_3bccc4(); +} diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl new file mode 100644 index 0000000000..529d56ae78 --- /dev/null +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void floor_3bccc4() { + float4 res = floor(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + floor_3bccc4(); + return; +} + +void fragment_main() { + floor_3bccc4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + floor_3bccc4(); + return; +} + diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl new file mode 100644 index 0000000000..5b5e7e41a9 --- /dev/null +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void floor_3bccc4() { + float4 res = floor(float4()); +} + +vertex void vertex_main() { + floor_3bccc4(); + return; +} + +fragment void fragment_main() { + floor_3bccc4(); + return; +} + +kernel void compute_main() { + floor_3bccc4(); + return; +} + diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm new file mode 100644 index 0000000000..baf11b1f55 --- /dev/null +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %floor_3bccc4 "floor_3bccc4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%floor_3bccc4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Floor %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %floor_3bccc4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %floor_3bccc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %floor_3bccc4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl new file mode 100644 index 0000000000..574e6b13b7 --- /dev/null +++ b/test/intrinsics/gen/floor/3bccc4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn floor_3bccc4() { + var res : vec4 = floor(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_3bccc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_3bccc4(); +} + +[[stage(compute)]] +fn compute_main() { + floor_3bccc4(); +} diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl new file mode 100644 index 0000000000..06d4b493e0 --- /dev/null +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn floor_5fc9ac() { + var res: vec2 = floor(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_5fc9ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_5fc9ac(); +} + +[[stage(compute)]] +fn compute_main() { + floor_5fc9ac(); +} diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl new file mode 100644 index 0000000000..241394d21e --- /dev/null +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void floor_5fc9ac() { + float2 res = floor(float2(0.0f, 0.0f)); +} + +void vertex_main() { + floor_5fc9ac(); + return; +} + +void fragment_main() { + floor_5fc9ac(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + floor_5fc9ac(); + return; +} + diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl new file mode 100644 index 0000000000..c337a9c82a --- /dev/null +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void floor_5fc9ac() { + float2 res = floor(float2()); +} + +vertex void vertex_main() { + floor_5fc9ac(); + return; +} + +fragment void fragment_main() { + floor_5fc9ac(); + return; +} + +kernel void compute_main() { + floor_5fc9ac(); + return; +} + diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm new file mode 100644 index 0000000000..81c4d3b513 --- /dev/null +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %floor_5fc9ac "floor_5fc9ac" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%floor_5fc9ac = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Floor %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %floor_5fc9ac + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %floor_5fc9ac + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %floor_5fc9ac + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl new file mode 100644 index 0000000000..40d3dcbc13 --- /dev/null +++ b/test/intrinsics/gen/floor/5fc9ac.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn floor_5fc9ac() { + var res : vec2 = floor(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_5fc9ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_5fc9ac(); +} + +[[stage(compute)]] +fn compute_main() { + floor_5fc9ac(); +} diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl new file mode 100644 index 0000000000..e04571b065 --- /dev/null +++ b/test/intrinsics/gen/floor/60d7ea.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn floor_60d7ea() { + var res: vec3 = floor(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_60d7ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_60d7ea(); +} + +[[stage(compute)]] +fn compute_main() { + floor_60d7ea(); +} diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl new file mode 100644 index 0000000000..85d68ae51d --- /dev/null +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void floor_60d7ea() { + float3 res = floor(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + floor_60d7ea(); + return; +} + +void fragment_main() { + floor_60d7ea(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + floor_60d7ea(); + return; +} + diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl new file mode 100644 index 0000000000..3cb741aec3 --- /dev/null +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void floor_60d7ea() { + float3 res = floor(float3()); +} + +vertex void vertex_main() { + floor_60d7ea(); + return; +} + +fragment void fragment_main() { + floor_60d7ea(); + return; +} + +kernel void compute_main() { + floor_60d7ea(); + return; +} + diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm new file mode 100644 index 0000000000..28b16f2c19 --- /dev/null +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %floor_60d7ea "floor_60d7ea" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%floor_60d7ea = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Floor %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %floor_60d7ea + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %floor_60d7ea + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %floor_60d7ea + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl new file mode 100644 index 0000000000..f21f972743 --- /dev/null +++ b/test/intrinsics/gen/floor/60d7ea.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn floor_60d7ea() { + var res : vec3 = floor(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_60d7ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_60d7ea(); +} + +[[stage(compute)]] +fn compute_main() { + floor_60d7ea(); +} diff --git a/test/intrinsics/gen/floor/66f154.wgsl b/test/intrinsics/gen/floor/66f154.wgsl new file mode 100644 index 0000000000..d0f5f332df --- /dev/null +++ b/test/intrinsics/gen/floor/66f154.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn floor_66f154() { + var res: f32 = floor(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_66f154(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_66f154(); +} + +[[stage(compute)]] +fn compute_main() { + floor_66f154(); +} diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl new file mode 100644 index 0000000000..7fb4b6d249 --- /dev/null +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void floor_66f154() { + float res = floor(1.0f); +} + +void vertex_main() { + floor_66f154(); + return; +} + +void fragment_main() { + floor_66f154(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + floor_66f154(); + return; +} + diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.msl b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl new file mode 100644 index 0000000000..4f57a10c06 --- /dev/null +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void floor_66f154() { + float res = floor(1.0f); +} + +vertex void vertex_main() { + floor_66f154(); + return; +} + +fragment void fragment_main() { + floor_66f154(); + return; +} + +kernel void compute_main() { + floor_66f154(); + return; +} + diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm new file mode 100644 index 0000000000..ea32487136 --- /dev/null +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %floor_66f154 "floor_66f154" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%floor_66f154 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Floor %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %floor_66f154 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %floor_66f154 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %floor_66f154 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl new file mode 100644 index 0000000000..0dc4d1371d --- /dev/null +++ b/test/intrinsics/gen/floor/66f154.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn floor_66f154() { + var res : f32 = floor(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + floor_66f154(); +} + +[[stage(fragment)]] +fn fragment_main() { + floor_66f154(); +} + +[[stage(compute)]] +fn compute_main() { + floor_66f154(); +} diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl new file mode 100644 index 0000000000..2660eeb9d1 --- /dev/null +++ b/test/intrinsics/gen/fma/26a7a9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fma_26a7a9() { + var res: vec2 = fma(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_26a7a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_26a7a9(); +} + +[[stage(compute)]] +fn compute_main() { + fma_26a7a9(); +} diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl new file mode 100644 index 0000000000..ddb3b74f74 --- /dev/null +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +void fma_26a7a9() { + float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + fma_26a7a9(); + return; +} + +void fragment_main() { + fma_26a7a9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fma_26a7a9(); + return; +} + + +tint_EKmo0D:2:16: error: no matching function for call to 'fma' + float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_EKmo0D:2:16: error: no matching function for call to 'fma' + float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_EKmo0D:2:16: error: no matching function for call to 'fma' + float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl new file mode 100644 index 0000000000..a1a1a5e7d5 --- /dev/null +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fma_26a7a9() { + float2 res = fma(float2(), float2(), float2()); +} + +vertex void vertex_main() { + fma_26a7a9(); + return; +} + +fragment void fragment_main() { + fma_26a7a9(); + return; +} + +kernel void compute_main() { + fma_26a7a9(); + return; +} + diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm new file mode 100644 index 0000000000..89f91acd78 --- /dev/null +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fma_26a7a9 "fma_26a7a9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %fma_26a7a9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Fma %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fma_26a7a9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fma_26a7a9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fma_26a7a9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl new file mode 100644 index 0000000000..aab4068854 --- /dev/null +++ b/test/intrinsics/gen/fma/26a7a9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fma_26a7a9() { + var res : vec2 = fma(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_26a7a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_26a7a9(); +} + +[[stage(compute)]] +fn compute_main() { + fma_26a7a9(); +} diff --git a/test/intrinsics/gen/fma/6a3283.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl new file mode 100644 index 0000000000..8ec11375bb --- /dev/null +++ b/test/intrinsics/gen/fma/6a3283.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fma_6a3283() { + var res: vec4 = fma(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_6a3283(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_6a3283(); +} + +[[stage(compute)]] +fn compute_main() { + fma_6a3283(); +} diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl new file mode 100644 index 0000000000..2fb09c9170 --- /dev/null +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +void fma_6a3283() { + float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fma_6a3283(); + return; +} + +void fragment_main() { + fma_6a3283(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fma_6a3283(); + return; +} + + +tint_dZoyK7:2:16: error: no matching function for call to 'fma' + float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_dZoyK7:2:16: error: no matching function for call to 'fma' + float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_dZoyK7:2:16: error: no matching function for call to 'fma' + float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl new file mode 100644 index 0000000000..c45bd40004 --- /dev/null +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fma_6a3283() { + float4 res = fma(float4(), float4(), float4()); +} + +vertex void vertex_main() { + fma_6a3283(); + return; +} + +fragment void fragment_main() { + fma_6a3283(); + return; +} + +kernel void compute_main() { + fma_6a3283(); + return; +} + diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm new file mode 100644 index 0000000000..160fecc28c --- /dev/null +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fma_6a3283 "fma_6a3283" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %fma_6a3283 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Fma %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fma_6a3283 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fma_6a3283 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fma_6a3283 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl new file mode 100644 index 0000000000..f8e9f345a4 --- /dev/null +++ b/test/intrinsics/gen/fma/6a3283.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fma_6a3283() { + var res : vec4 = fma(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_6a3283(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_6a3283(); +} + +[[stage(compute)]] +fn compute_main() { + fma_6a3283(); +} diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl new file mode 100644 index 0000000000..9bc8727920 --- /dev/null +++ b/test/intrinsics/gen/fma/c10ba3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fma_c10ba3() { + var res: f32 = fma(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_c10ba3(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_c10ba3(); +} + +[[stage(compute)]] +fn compute_main() { + fma_c10ba3(); +} diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl new file mode 100644 index 0000000000..5aa77e7a39 --- /dev/null +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +void fma_c10ba3() { + float res = fma(1.0f, 1.0f, 1.0f); +} + +void vertex_main() { + fma_c10ba3(); + return; +} + +void fragment_main() { + fma_c10ba3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fma_c10ba3(); + return; +} + + +tint_6WuQ1K:2:15: error: no matching function for call to 'fma' + float res = fma(1.0f, 1.0f, 1.0f); + ^~~ +note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument + + +tint_6WuQ1K:2:15: error: no matching function for call to 'fma' + float res = fma(1.0f, 1.0f, 1.0f); + ^~~ +note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument + + +tint_6WuQ1K:2:15: error: no matching function for call to 'fma' + float res = fma(1.0f, 1.0f, 1.0f); + ^~~ +note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument + diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl new file mode 100644 index 0000000000..0ad9e9ce4c --- /dev/null +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fma_c10ba3() { + float res = fma(1.0f, 1.0f, 1.0f); +} + +vertex void vertex_main() { + fma_c10ba3(); + return; +} + +fragment void fragment_main() { + fma_c10ba3(); + return; +} + +kernel void compute_main() { + fma_c10ba3(); + return; +} + diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm new file mode 100644 index 0000000000..cd28d8ea53 --- /dev/null +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fma_c10ba3 "fma_c10ba3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %fma_c10ba3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Fma %float_1 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %fma_c10ba3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %fma_c10ba3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %fma_c10ba3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl new file mode 100644 index 0000000000..58f5b948ba --- /dev/null +++ b/test/intrinsics/gen/fma/c10ba3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fma_c10ba3() { + var res : f32 = fma(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_c10ba3(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_c10ba3(); +} + +[[stage(compute)]] +fn compute_main() { + fma_c10ba3(); +} diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl new file mode 100644 index 0000000000..2f788d3860 --- /dev/null +++ b/test/intrinsics/gen/fma/e17c5c.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fma_e17c5c() { + var res: vec3 = fma(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_e17c5c(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_e17c5c(); +} + +[[stage(compute)]] +fn compute_main() { + fma_e17c5c(); +} diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl new file mode 100644 index 0000000000..01b8be3687 --- /dev/null +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +void fma_e17c5c() { + float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fma_e17c5c(); + return; +} + +void fragment_main() { + fma_e17c5c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fma_e17c5c(); + return; +} + + +tint_5UHLns:2:16: error: no matching function for call to 'fma' + float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_5UHLns:2:16: error: no matching function for call to 'fma' + float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + + +tint_5UHLns:2:16: error: no matching function for call to 'fma' + float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^~~ +note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument + diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl new file mode 100644 index 0000000000..fb58389fdc --- /dev/null +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fma_e17c5c() { + float3 res = fma(float3(), float3(), float3()); +} + +vertex void vertex_main() { + fma_e17c5c(); + return; +} + +fragment void fragment_main() { + fma_e17c5c(); + return; +} + +kernel void compute_main() { + fma_e17c5c(); + return; +} + diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm new file mode 100644 index 0000000000..f53397558c --- /dev/null +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fma_e17c5c "fma_e17c5c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %fma_e17c5c = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Fma %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fma_e17c5c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fma_e17c5c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fma_e17c5c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl new file mode 100644 index 0000000000..23ed6e29a9 --- /dev/null +++ b/test/intrinsics/gen/fma/e17c5c.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fma_e17c5c() { + var res : vec3 = fma(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fma_e17c5c(); +} + +[[stage(fragment)]] +fn fragment_main() { + fma_e17c5c(); +} + +[[stage(compute)]] +fn compute_main() { + fma_e17c5c(); +} diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl new file mode 100644 index 0000000000..7c2e38b375 --- /dev/null +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fract_8bc1e9() { + var res: vec4 = fract(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_8bc1e9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_8bc1e9(); +} + +[[stage(compute)]] +fn compute_main() { + fract_8bc1e9(); +} diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl new file mode 100644 index 0000000000..5cf81410ce --- /dev/null +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fract_8bc1e9() { + float4 res = frac(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fract_8bc1e9(); + return; +} + +void fragment_main() { + fract_8bc1e9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fract_8bc1e9(); + return; +} + diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl new file mode 100644 index 0000000000..cd30c06baa --- /dev/null +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fract_8bc1e9() { + float4 res = fract(float4()); +} + +vertex void vertex_main() { + fract_8bc1e9(); + return; +} + +fragment void fragment_main() { + fract_8bc1e9(); + return; +} + +kernel void compute_main() { + fract_8bc1e9(); + return; +} + diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm new file mode 100644 index 0000000000..bb69bbd096 --- /dev/null +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fract_8bc1e9 "fract_8bc1e9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%fract_8bc1e9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Fract %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fract_8bc1e9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fract_8bc1e9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fract_8bc1e9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl new file mode 100644 index 0000000000..5107174b1e --- /dev/null +++ b/test/intrinsics/gen/fract/8bc1e9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fract_8bc1e9() { + var res : vec4 = fract(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_8bc1e9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_8bc1e9(); +} + +[[stage(compute)]] +fn compute_main() { + fract_8bc1e9(); +} diff --git a/test/intrinsics/gen/fract/943cb1.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl new file mode 100644 index 0000000000..754cd7d245 --- /dev/null +++ b/test/intrinsics/gen/fract/943cb1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fract_943cb1() { + var res: vec2 = fract(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_943cb1(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_943cb1(); +} + +[[stage(compute)]] +fn compute_main() { + fract_943cb1(); +} diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl new file mode 100644 index 0000000000..4a9152de07 --- /dev/null +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fract_943cb1() { + float2 res = frac(float2(0.0f, 0.0f)); +} + +void vertex_main() { + fract_943cb1(); + return; +} + +void fragment_main() { + fract_943cb1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fract_943cb1(); + return; +} + diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl new file mode 100644 index 0000000000..8df4530d6f --- /dev/null +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fract_943cb1() { + float2 res = fract(float2()); +} + +vertex void vertex_main() { + fract_943cb1(); + return; +} + +fragment void fragment_main() { + fract_943cb1(); + return; +} + +kernel void compute_main() { + fract_943cb1(); + return; +} + diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm new file mode 100644 index 0000000000..e1b796545b --- /dev/null +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fract_943cb1 "fract_943cb1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%fract_943cb1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Fract %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fract_943cb1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fract_943cb1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fract_943cb1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl new file mode 100644 index 0000000000..88db883e30 --- /dev/null +++ b/test/intrinsics/gen/fract/943cb1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fract_943cb1() { + var res : vec2 = fract(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_943cb1(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_943cb1(); +} + +[[stage(compute)]] +fn compute_main() { + fract_943cb1(); +} diff --git a/test/intrinsics/gen/fract/a49758.wgsl b/test/intrinsics/gen/fract/a49758.wgsl new file mode 100644 index 0000000000..d5f4528c6f --- /dev/null +++ b/test/intrinsics/gen/fract/a49758.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fract_a49758() { + var res: vec3 = fract(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_a49758(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_a49758(); +} + +[[stage(compute)]] +fn compute_main() { + fract_a49758(); +} diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl new file mode 100644 index 0000000000..4f27c5f579 --- /dev/null +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fract_a49758() { + float3 res = frac(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fract_a49758(); + return; +} + +void fragment_main() { + fract_a49758(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fract_a49758(); + return; +} + diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.msl b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl new file mode 100644 index 0000000000..6c302f2a3a --- /dev/null +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fract_a49758() { + float3 res = fract(float3()); +} + +vertex void vertex_main() { + fract_a49758(); + return; +} + +fragment void fragment_main() { + fract_a49758(); + return; +} + +kernel void compute_main() { + fract_a49758(); + return; +} + diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm new file mode 100644 index 0000000000..ef18a353c0 --- /dev/null +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fract_a49758 "fract_a49758" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%fract_a49758 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Fract %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %fract_a49758 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fract_a49758 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %fract_a49758 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl new file mode 100644 index 0000000000..f20dc80eb5 --- /dev/null +++ b/test/intrinsics/gen/fract/a49758.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fract_a49758() { + var res : vec3 = fract(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_a49758(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_a49758(); +} + +[[stage(compute)]] +fn compute_main() { + fract_a49758(); +} diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl new file mode 100644 index 0000000000..26b513ac44 --- /dev/null +++ b/test/intrinsics/gen/fract/fa5c71.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fract_fa5c71() { + var res: f32 = fract(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_fa5c71(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_fa5c71(); +} + +[[stage(compute)]] +fn compute_main() { + fract_fa5c71(); +} diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl new file mode 100644 index 0000000000..927ec31ede --- /dev/null +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fract_fa5c71() { + float res = frac(1.0f); +} + +void vertex_main() { + fract_fa5c71(); + return; +} + +void fragment_main() { + fract_fa5c71(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fract_fa5c71(); + return; +} + diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl new file mode 100644 index 0000000000..5f113c2abf --- /dev/null +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void fract_fa5c71() { + float res = fract(1.0f); +} + +vertex void vertex_main() { + fract_fa5c71(); + return; +} + +fragment void fragment_main() { + fract_fa5c71(); + return; +} + +kernel void compute_main() { + fract_fa5c71(); + return; +} + diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm new file mode 100644 index 0000000000..5003c11bc8 --- /dev/null +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fract_fa5c71 "fract_fa5c71" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%fract_fa5c71 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Fract %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %fract_fa5c71 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %fract_fa5c71 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %fract_fa5c71 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl new file mode 100644 index 0000000000..c2bed7c493 --- /dev/null +++ b/test/intrinsics/gen/fract/fa5c71.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fract_fa5c71() { + var res : f32 = fract(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fract_fa5c71(); +} + +[[stage(fragment)]] +fn fragment_main() { + fract_fa5c71(); +} + +[[stage(compute)]] +fn compute_main() { + fract_fa5c71(); +} diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl new file mode 100644 index 0000000000..485a26d2ed --- /dev/null +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_1d6b62() { + var arg_1: vec2; + var res: vec2 = frexp(vec2(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_1d6b62(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_1d6b62(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_1d6b62(); +} diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl new file mode 100644 index 0000000000..4bfcbe066d --- /dev/null +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_1d6b62() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_1d6b62(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_1d6b62(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_1d6b62(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl new file mode 100644 index 0000000000..569c4e6b0b --- /dev/null +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_1d6b62() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_1d6b62(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_1d6b62(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_1d6b62(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm new file mode 100644 index 0000000000..f697f5921e --- /dev/null +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_1d6b62 "frexp_1d6b62" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Function_v2int = OpTypePointer Function %v2int + %13 = OpConstantNull %v2int + %v2float = OpTypeVector %float 2 + %17 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%frexp_1d6b62 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2int Function %13 + %res = OpVariable %_ptr_Function_v2float Function %17 + %14 = OpExtInst %v2float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_1d6b62 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_1d6b62 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_1d6b62 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl new file mode 100644 index 0000000000..9222be812a --- /dev/null +++ b/test/intrinsics/gen/frexp/1d6b62.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_1d6b62() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_1d6b62(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_1d6b62(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_1d6b62(); +} diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl new file mode 100644 index 0000000000..6e77b4aacc --- /dev/null +++ b/test/intrinsics/gen/frexp/2507b2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_2507b2() { + var arg_1: vec4; + var res: vec4 = frexp(vec4(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2507b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2507b2(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2507b2(); +} diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl new file mode 100644 index 0000000000..620eb05a2d --- /dev/null +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_2507b2() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2507b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2507b2(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2507b2(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl new file mode 100644 index 0000000000..1a9febb800 --- /dev/null +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_2507b2() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2507b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2507b2(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2507b2(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm new file mode 100644 index 0000000000..9f3228fc42 --- /dev/null +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_2507b2 "frexp_2507b2" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %13 = OpConstantNull %v4uint + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%frexp_2507b2 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4uint Function %13 + %res = OpVariable %_ptr_Function_v4float Function %17 + %14 = OpExtInst %v4float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_2507b2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_2507b2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_2507b2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl new file mode 100644 index 0000000000..436b452090 --- /dev/null +++ b/test/intrinsics/gen/frexp/2507b2.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_2507b2() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2507b2(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2507b2(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2507b2(); +} diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl new file mode 100644 index 0000000000..d23094be15 --- /dev/null +++ b/test/intrinsics/gen/frexp/2a171c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_2a171c() { + var arg_1: vec2; + var res: vec2 = frexp(vec2(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2a171c(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2a171c(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2a171c(); +} diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl new file mode 100644 index 0000000000..0e7067056c --- /dev/null +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_2a171c() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2a171c(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2a171c(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2a171c(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl new file mode 100644 index 0000000000..ea365cffb9 --- /dev/null +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_2a171c() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2a171c(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2a171c(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2a171c(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm new file mode 100644 index 0000000000..3fa83d3165 --- /dev/null +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_2a171c "frexp_2a171c" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %13 = OpConstantNull %v2uint + %v2float = OpTypeVector %float 2 + %17 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%frexp_2a171c = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2uint Function %13 + %res = OpVariable %_ptr_Function_v2float Function %17 + %14 = OpExtInst %v2float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_2a171c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_2a171c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_2a171c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl new file mode 100644 index 0000000000..e5bdf95d02 --- /dev/null +++ b/test/intrinsics/gen/frexp/2a171c.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_2a171c() { + var arg_1 : vec2; + var res : vec2 = frexp(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_2a171c(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_2a171c(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_2a171c(); +} diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl new file mode 100644 index 0000000000..848bd3f157 --- /dev/null +++ b/test/intrinsics/gen/frexp/34dd30.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_34dd30() { + var arg_1: u32; + var res: f32 = frexp(1.0, &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_34dd30(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_34dd30(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_34dd30(); +} diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl new file mode 100644 index 0000000000..ee41ea0c60 --- /dev/null +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_34dd30() { + var arg_1 : u32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_34dd30(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_34dd30(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_34dd30(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl new file mode 100644 index 0000000000..05171f12e3 --- /dev/null +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_34dd30() { + var arg_1 : u32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_34dd30(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_34dd30(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_34dd30(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm new file mode 100644 index 0000000000..2e9b4d9772 --- /dev/null +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_34dd30 "frexp_34dd30" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %12 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%frexp_34dd30 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_uint Function %12 + %res = OpVariable %_ptr_Function_float Function %4 + %13 = OpExtInst %float %14 Frexp %float_1 %arg_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %frexp_34dd30 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %frexp_34dd30 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_34dd30 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl new file mode 100644 index 0000000000..c43e4c1b68 --- /dev/null +++ b/test/intrinsics/gen/frexp/34dd30.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_34dd30() { + var arg_1 : u32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_34dd30(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_34dd30(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_34dd30(); +} diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl new file mode 100644 index 0000000000..d4c58427c8 --- /dev/null +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_4b73e3() { + var arg_1: vec4; + var res: vec4 = frexp(vec4(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_4b73e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_4b73e3(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_4b73e3(); +} diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl new file mode 100644 index 0000000000..238343c3b6 --- /dev/null +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_4b73e3() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_4b73e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_4b73e3(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_4b73e3(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl new file mode 100644 index 0000000000..d993f99cf2 --- /dev/null +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_4b73e3() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_4b73e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_4b73e3(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_4b73e3(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm new file mode 100644 index 0000000000..ab2f023fc8 --- /dev/null +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_4b73e3 "frexp_4b73e3" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %13 = OpConstantNull %v4int + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%frexp_4b73e3 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4int Function %13 + %res = OpVariable %_ptr_Function_v4float Function %17 + %14 = OpExtInst %v4float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_4b73e3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_4b73e3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_4b73e3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl new file mode 100644 index 0000000000..3672ae0bbd --- /dev/null +++ b/test/intrinsics/gen/frexp/4b73e3.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_4b73e3() { + var arg_1 : vec4; + var res : vec4 = frexp(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_4b73e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_4b73e3(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_4b73e3(); +} diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl new file mode 100644 index 0000000000..2acbd4c709 --- /dev/null +++ b/test/intrinsics/gen/frexp/79ed81.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_79ed81() { + var arg_1: vec3; + var res: vec3 = frexp(vec3(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_79ed81(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_79ed81(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_79ed81(); +} diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl new file mode 100644 index 0000000000..21b606efc8 --- /dev/null +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_79ed81() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_79ed81(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_79ed81(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_79ed81(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl new file mode 100644 index 0000000000..7b06582af0 --- /dev/null +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_79ed81() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_79ed81(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_79ed81(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_79ed81(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a7f73631b --- /dev/null +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_79ed81 "frexp_79ed81" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_v3int = OpTypePointer Function %v3int + %13 = OpConstantNull %v3int + %v3float = OpTypeVector %float 3 + %17 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%frexp_79ed81 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3int Function %13 + %res = OpVariable %_ptr_Function_v3float Function %17 + %14 = OpExtInst %v3float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_79ed81 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_79ed81 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_79ed81 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl new file mode 100644 index 0000000000..170e25514d --- /dev/null +++ b/test/intrinsics/gen/frexp/79ed81.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_79ed81() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_79ed81(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_79ed81(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_79ed81(); +} diff --git a/test/intrinsics/gen/frexp/99b922.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl new file mode 100644 index 0000000000..5d2cf6e812 --- /dev/null +++ b/test/intrinsics/gen/frexp/99b922.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_99b922() { + var arg_1: i32; + var res: f32 = frexp(1.0, &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_99b922(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_99b922(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_99b922(); +} diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl new file mode 100644 index 0000000000..14fef02912 --- /dev/null +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_99b922() { + var arg_1 : i32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_99b922(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_99b922(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_99b922(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl new file mode 100644 index 0000000000..1a98e37449 --- /dev/null +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_99b922() { + var arg_1 : i32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_99b922(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_99b922(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_99b922(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm new file mode 100644 index 0000000000..03670ba496 --- /dev/null +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_99b922 "frexp_99b922" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %12 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%frexp_99b922 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_int Function %12 + %res = OpVariable %_ptr_Function_float Function %4 + %13 = OpExtInst %float %14 Frexp %float_1 %arg_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %frexp_99b922 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %frexp_99b922 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_99b922 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl new file mode 100644 index 0000000000..e07d4c3b1e --- /dev/null +++ b/test/intrinsics/gen/frexp/99b922.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_99b922() { + var arg_1 : i32; + var res : f32 = frexp(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_99b922(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_99b922(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_99b922(); +} diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl new file mode 100644 index 0000000000..298d24ea8e --- /dev/null +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn frexp_cb41c5() { + var arg_1: vec3; + var res: vec3 = frexp(vec3(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_cb41c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_cb41c5(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_cb41c5(); +} diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl new file mode 100644 index 0000000000..820b4519e4 --- /dev/null +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_cb41c5() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_cb41c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_cb41c5(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_cb41c5(); +} + +Failed to generate: error: Unknown builtin method: frexp diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl new file mode 100644 index 0000000000..ab6546f1af --- /dev/null +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn frexp_cb41c5() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_cb41c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_cb41c5(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_cb41c5(); +} + +Failed to generate: error: Unknown import method: frexp diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm new file mode 100644 index 0000000000..bec511a9c7 --- /dev/null +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + %16 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %frexp_cb41c5 "frexp_cb41c5" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %13 = OpConstantNull %v3uint + %v3float = OpTypeVector %float 3 + %17 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%frexp_cb41c5 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3uint Function %13 + %res = OpVariable %_ptr_Function_v3float Function %17 + %14 = OpExtInst %v3float %16 Frexp %17 %arg_1 + OpStore %res %14 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %frexp_cb41c5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %frexp_cb41c5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %29 = OpLabel + %30 = OpFunctionCall %void %frexp_cb41c5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl new file mode 100644 index 0000000000..7fcb8e0ca1 --- /dev/null +++ b/test/intrinsics/gen/frexp/cb41c5.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn frexp_cb41c5() { + var arg_1 : vec3; + var res : vec3 = frexp(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + frexp_cb41c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + frexp_cb41c5(); +} + +[[stage(compute)]] +fn compute_main() { + frexp_cb41c5(); +} diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl new file mode 100644 index 0000000000..3a7a285f72 --- /dev/null +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidth_5d1b39() { + var res: vec3 = fwidth(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_5d1b39(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_5d1b39(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_5d1b39(); +} diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl new file mode 100644 index 0000000000..1d700b1ef6 --- /dev/null +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidth_5d1b39() { + float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidth_5d1b39(); + return; +} + +void fragment_main() { + fwidth_5d1b39(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidth_5d1b39(); + return; +} + diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl new file mode 100644 index 0000000000..6d2c8fc7da --- /dev/null +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidth_5d1b39() { + float3 res = fwidth(float3()); +} + +vertex void vertex_main() { + fwidth_5d1b39(); + return; +} + +fragment void fragment_main() { + fwidth_5d1b39(); + return; +} + +kernel void compute_main() { + fwidth_5d1b39(); + return; +} + + +tint_6o3PFV.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float3 res = fwidth(float3()); + ^ +tint_6o3PFV.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a vertex function +tint_6o3PFV.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm new file mode 100644 index 0000000000..4816e1099b --- /dev/null +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidth_5d1b39 "fwidth_5d1b39" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %11 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%fwidth_5d1b39 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %11 + %9 = OpFwidth %v3float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidth_5d1b39 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidth_5d1b39 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidth_5d1b39 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidth_5d1b39], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: Fwidth + + %fwidth_5d1b39 = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl new file mode 100644 index 0000000000..bee6d3ffa1 --- /dev/null +++ b/test/intrinsics/gen/fwidth/5d1b39.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidth_5d1b39() { + var res : vec3 = fwidth(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_5d1b39(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_5d1b39(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_5d1b39(); +} diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl new file mode 100644 index 0000000000..9f657d16ae --- /dev/null +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidth_b83ebb() { + var res: vec2 = fwidth(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_b83ebb(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_b83ebb(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_b83ebb(); +} diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl new file mode 100644 index 0000000000..db5d8aa7ae --- /dev/null +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidth_b83ebb() { + float2 res = fwidth(float2(0.0f, 0.0f)); +} + +void vertex_main() { + fwidth_b83ebb(); + return; +} + +void fragment_main() { + fwidth_b83ebb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidth_b83ebb(); + return; +} + diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl new file mode 100644 index 0000000000..b01f8dde50 --- /dev/null +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidth_b83ebb() { + float2 res = fwidth(float2()); +} + +vertex void vertex_main() { + fwidth_b83ebb(); + return; +} + +fragment void fragment_main() { + fwidth_b83ebb(); + return; +} + +kernel void compute_main() { + fwidth_b83ebb(); + return; +} + + +tint_STFkVK.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float2 res = fwidth(float2()); + ^ +tint_STFkVK.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a vertex function +tint_STFkVK.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm new file mode 100644 index 0000000000..b22356f326 --- /dev/null +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidth_b83ebb "fwidth_b83ebb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %11 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%fwidth_b83ebb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %11 + %9 = OpFwidth %v2float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidth_b83ebb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidth_b83ebb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidth_b83ebb + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidth_b83ebb], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: Fwidth + + %fwidth_b83ebb = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl new file mode 100644 index 0000000000..4618777876 --- /dev/null +++ b/test/intrinsics/gen/fwidth/b83ebb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidth_b83ebb() { + var res : vec2 = fwidth(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_b83ebb(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_b83ebb(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_b83ebb(); +} diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl new file mode 100644 index 0000000000..1110b54333 --- /dev/null +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidth_d2ab9a() { + var res: vec4 = fwidth(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_d2ab9a(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_d2ab9a(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_d2ab9a(); +} diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl new file mode 100644 index 0000000000..e963fc6a3e --- /dev/null +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidth_d2ab9a() { + float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidth_d2ab9a(); + return; +} + +void fragment_main() { + fwidth_d2ab9a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidth_d2ab9a(); + return; +} + diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl new file mode 100644 index 0000000000..af3f56b474 --- /dev/null +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidth_d2ab9a() { + float4 res = fwidth(float4()); +} + +vertex void vertex_main() { + fwidth_d2ab9a(); + return; +} + +fragment void fragment_main() { + fwidth_d2ab9a(); + return; +} + +kernel void compute_main() { + fwidth_d2ab9a(); + return; +} + + +tint_BZ4hJz.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float4 res = fwidth(float4()); + ^ +tint_BZ4hJz.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a vertex function +tint_BZ4hJz.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm new file mode 100644 index 0000000000..0ce3af07b1 --- /dev/null +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidth_d2ab9a "fwidth_d2ab9a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %11 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%fwidth_d2ab9a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %9 = OpFwidth %v4float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidth_d2ab9a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidth_d2ab9a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidth_d2ab9a + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidth_d2ab9a], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: Fwidth + + %fwidth_d2ab9a = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl new file mode 100644 index 0000000000..95ec91a24f --- /dev/null +++ b/test/intrinsics/gen/fwidth/d2ab9a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidth_d2ab9a() { + var res : vec4 = fwidth(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_d2ab9a(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_d2ab9a(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_d2ab9a(); +} diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl new file mode 100644 index 0000000000..d83071290d --- /dev/null +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidth_df38ef() { + var res: f32 = fwidth(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_df38ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_df38ef(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_df38ef(); +} diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl new file mode 100644 index 0000000000..4610453e06 --- /dev/null +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidth_df38ef() { + float res = fwidth(1.0f); +} + +void vertex_main() { + fwidth_df38ef(); + return; +} + +void fragment_main() { + fwidth_df38ef(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidth_df38ef(); + return; +} + diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl new file mode 100644 index 0000000000..c63e604c37 --- /dev/null +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidth_df38ef() { + float res = fwidth(1.0f); +} + +vertex void vertex_main() { + fwidth_df38ef(); + return; +} + +fragment void fragment_main() { + fwidth_df38ef(); + return; +} + +kernel void compute_main() { + fwidth_df38ef(); + return; +} + + +tint_YeBAYS.metal:5:9: warning: unused variable 'res' [-Wunused-variable] + float res = fwidth(1.0f); + ^ +tint_YeBAYS.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.f32 is not allowed within a vertex function +tint_YeBAYS.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm new file mode 100644 index 0000000000..7dcebbcb97 --- /dev/null +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidth_df38ef "fwidth_df38ef" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%fwidth_df38ef = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpFwidth %float %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %14 = OpLabel + OpStore %tint_pointsize %float_1 + %15 = OpFunctionCall %void %fwidth_df38ef + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %17 = OpLabel + %18 = OpFunctionCall %void %fwidth_df38ef + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fwidth_df38ef + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '13[%vertex_main]'s callgraph contains function 7[%fwidth_df38ef], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: Fwidth + + %fwidth_df38ef = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl new file mode 100644 index 0000000000..cf808fe10c --- /dev/null +++ b/test/intrinsics/gen/fwidth/df38ef.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidth_df38ef() { + var res : f32 = fwidth(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidth_df38ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidth_df38ef(); +} + +[[stage(compute)]] +fn compute_main() { + fwidth_df38ef(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl new file mode 100644 index 0000000000..eb1a5da293 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthCoarse_159c8a() { + var res: f32 = fwidthCoarse(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_159c8a(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_159c8a(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_159c8a(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl new file mode 100644 index 0000000000..356be65fd8 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthCoarse_159c8a() { + float res = fwidth(1.0f); +} + +void vertex_main() { + fwidthCoarse_159c8a(); + return; +} + +void fragment_main() { + fwidthCoarse_159c8a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthCoarse_159c8a(); + return; +} + diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl new file mode 100644 index 0000000000..18857effca --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthCoarse_159c8a() { + float res = fwidth(1.0f); +} + +vertex void vertex_main() { + fwidthCoarse_159c8a(); + return; +} + +fragment void fragment_main() { + fwidthCoarse_159c8a(); + return; +} + +kernel void compute_main() { + fwidthCoarse_159c8a(); + return; +} + + +tint_IJRHv8.metal:5:9: warning: unused variable 'res' [-Wunused-variable] + float res = fwidth(1.0f); + ^ +tint_IJRHv8.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.f32 is not allowed within a vertex function +tint_IJRHv8.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm new file mode 100644 index 0000000000..12a2effdf1 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthCoarse_159c8a "fwidthCoarse_159c8a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%fwidthCoarse_159c8a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpFwidthCoarse %float %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %14 = OpLabel + OpStore %tint_pointsize %float_1 + %15 = OpFunctionCall %void %fwidthCoarse_159c8a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %17 = OpLabel + %18 = OpFunctionCall %void %fwidthCoarse_159c8a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fwidthCoarse_159c8a + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '13[%vertex_main]'s callgraph contains function 7[%fwidthCoarse_159c8a], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse + + %fwidthCoarse_159c8a = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl new file mode 100644 index 0000000000..38b8696c6e --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/159c8a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthCoarse_159c8a() { + var res : f32 = fwidthCoarse(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_159c8a(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_159c8a(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_159c8a(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl new file mode 100644 index 0000000000..05b4fcf0db --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthCoarse_1e59d9() { + var res: vec3 = fwidthCoarse(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_1e59d9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_1e59d9(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_1e59d9(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl new file mode 100644 index 0000000000..e3e1f18fd7 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthCoarse_1e59d9() { + float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidthCoarse_1e59d9(); + return; +} + +void fragment_main() { + fwidthCoarse_1e59d9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthCoarse_1e59d9(); + return; +} + diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl new file mode 100644 index 0000000000..1d34e453c9 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthCoarse_1e59d9() { + float3 res = fwidth(float3()); +} + +vertex void vertex_main() { + fwidthCoarse_1e59d9(); + return; +} + +fragment void fragment_main() { + fwidthCoarse_1e59d9(); + return; +} + +kernel void compute_main() { + fwidthCoarse_1e59d9(); + return; +} + + +tint_nMosr7.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float3 res = fwidth(float3()); + ^ +tint_nMosr7.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a vertex function +tint_nMosr7.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm new file mode 100644 index 0000000000..e15f0500d3 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthCoarse_1e59d9 "fwidthCoarse_1e59d9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %11 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%fwidthCoarse_1e59d9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %11 + %9 = OpFwidthCoarse %v3float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthCoarse_1e59d9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthCoarse_1e59d9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthCoarse_1e59d9 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthCoarse_1e59d9], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse + + %fwidthCoarse_1e59d9 = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl new file mode 100644 index 0000000000..adb83b7302 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/1e59d9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthCoarse_1e59d9() { + var res : vec3 = fwidthCoarse(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_1e59d9(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_1e59d9(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_1e59d9(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl new file mode 100644 index 0000000000..933322fe29 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthCoarse_4e4fc4() { + var res: vec4 = fwidthCoarse(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_4e4fc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_4e4fc4(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_4e4fc4(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl new file mode 100644 index 0000000000..ba1c1410c7 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthCoarse_4e4fc4() { + float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidthCoarse_4e4fc4(); + return; +} + +void fragment_main() { + fwidthCoarse_4e4fc4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthCoarse_4e4fc4(); + return; +} + diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl new file mode 100644 index 0000000000..476cee9a83 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthCoarse_4e4fc4() { + float4 res = fwidth(float4()); +} + +vertex void vertex_main() { + fwidthCoarse_4e4fc4(); + return; +} + +fragment void fragment_main() { + fwidthCoarse_4e4fc4(); + return; +} + +kernel void compute_main() { + fwidthCoarse_4e4fc4(); + return; +} + + +tint_Rs09zG.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float4 res = fwidth(float4()); + ^ +tint_Rs09zG.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a vertex function +tint_Rs09zG.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm new file mode 100644 index 0000000000..4edff8c1f8 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthCoarse_4e4fc4 "fwidthCoarse_4e4fc4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %11 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%fwidthCoarse_4e4fc4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %9 = OpFwidthCoarse %v4float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthCoarse_4e4fc4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthCoarse_4e4fc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthCoarse_4e4fc4 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthCoarse_4e4fc4], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse + + %fwidthCoarse_4e4fc4 = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl new file mode 100644 index 0000000000..245a06c321 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/4e4fc4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthCoarse_4e4fc4() { + var res : vec4 = fwidthCoarse(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_4e4fc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_4e4fc4(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_4e4fc4(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl new file mode 100644 index 0000000000..928a912a7d --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthCoarse_e653f7() { + var res: vec2 = fwidthCoarse(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_e653f7(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_e653f7(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_e653f7(); +} diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl new file mode 100644 index 0000000000..dc9e72136f --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthCoarse_e653f7() { + float2 res = fwidth(float2(0.0f, 0.0f)); +} + +void vertex_main() { + fwidthCoarse_e653f7(); + return; +} + +void fragment_main() { + fwidthCoarse_e653f7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthCoarse_e653f7(); + return; +} + diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl new file mode 100644 index 0000000000..1cccfb76c2 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthCoarse_e653f7() { + float2 res = fwidth(float2()); +} + +vertex void vertex_main() { + fwidthCoarse_e653f7(); + return; +} + +fragment void fragment_main() { + fwidthCoarse_e653f7(); + return; +} + +kernel void compute_main() { + fwidthCoarse_e653f7(); + return; +} + + +tint_YU6pTb.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float2 res = fwidth(float2()); + ^ +tint_YU6pTb.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a vertex function +tint_YU6pTb.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm new file mode 100644 index 0000000000..137bfd8500 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthCoarse_e653f7 "fwidthCoarse_e653f7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %11 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%fwidthCoarse_e653f7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %11 + %9 = OpFwidthCoarse %v2float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthCoarse_e653f7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthCoarse_e653f7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthCoarse_e653f7 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthCoarse_e653f7], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthCoarse + + %fwidthCoarse_e653f7 = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl new file mode 100644 index 0000000000..c0568f99c5 --- /dev/null +++ b/test/intrinsics/gen/fwidthCoarse/e653f7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthCoarse_e653f7() { + var res : vec2 = fwidthCoarse(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthCoarse_e653f7(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthCoarse_e653f7(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthCoarse_e653f7(); +} diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl new file mode 100644 index 0000000000..2db8dfb463 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthFine_523fdc() { + var res: vec3 = fwidthFine(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_523fdc(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_523fdc(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_523fdc(); +} diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl new file mode 100644 index 0000000000..a270d2dd35 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthFine_523fdc() { + float3 res = fwidth(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidthFine_523fdc(); + return; +} + +void fragment_main() { + fwidthFine_523fdc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthFine_523fdc(); + return; +} + diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl new file mode 100644 index 0000000000..8b5d8dae95 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthFine_523fdc() { + float3 res = fwidth(float3()); +} + +vertex void vertex_main() { + fwidthFine_523fdc(); + return; +} + +fragment void fragment_main() { + fwidthFine_523fdc(); + return; +} + +kernel void compute_main() { + fwidthFine_523fdc(); + return; +} + + +tint_T9vWZ8.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float3 res = fwidth(float3()); + ^ +tint_T9vWZ8.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a vertex function +tint_T9vWZ8.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v3f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm new file mode 100644 index 0000000000..622b3183e8 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthFine_523fdc "fwidthFine_523fdc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %11 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%fwidthFine_523fdc = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %11 + %9 = OpFwidthFine %v3float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthFine_523fdc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthFine_523fdc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthFine_523fdc + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthFine_523fdc], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthFine + + %fwidthFine_523fdc = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl new file mode 100644 index 0000000000..e7c73a9daf --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/523fdc.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthFine_523fdc() { + var res : vec3 = fwidthFine(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_523fdc(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_523fdc(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_523fdc(); +} diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl new file mode 100644 index 0000000000..de6e3febec --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthFine_68f4ef() { + var res: vec4 = fwidthFine(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_68f4ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_68f4ef(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_68f4ef(); +} diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl new file mode 100644 index 0000000000..23406ee9e1 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthFine_68f4ef() { + float4 res = fwidth(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + fwidthFine_68f4ef(); + return; +} + +void fragment_main() { + fwidthFine_68f4ef(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthFine_68f4ef(); + return; +} + diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl new file mode 100644 index 0000000000..d1afd55106 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthFine_68f4ef() { + float4 res = fwidth(float4()); +} + +vertex void vertex_main() { + fwidthFine_68f4ef(); + return; +} + +fragment void fragment_main() { + fwidthFine_68f4ef(); + return; +} + +kernel void compute_main() { + fwidthFine_68f4ef(); + return; +} + + +tint_ojzEQ7.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float4 res = fwidth(float4()); + ^ +tint_ojzEQ7.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a vertex function +tint_ojzEQ7.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v4f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm new file mode 100644 index 0000000000..7a2cfe768c --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthFine_68f4ef "fwidthFine_68f4ef" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %11 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%fwidthFine_68f4ef = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %9 = OpFwidthFine %v4float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthFine_68f4ef + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthFine_68f4ef + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthFine_68f4ef + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthFine_68f4ef], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthFine + + %fwidthFine_68f4ef = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl new file mode 100644 index 0000000000..9cc262520c --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/68f4ef.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthFine_68f4ef() { + var res : vec4 = fwidthFine(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_68f4ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_68f4ef(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_68f4ef(); +} diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl new file mode 100644 index 0000000000..be30a23fcb --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthFine_f1742d() { + var res: f32 = fwidthFine(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_f1742d(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_f1742d(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_f1742d(); +} diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl new file mode 100644 index 0000000000..774093a398 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthFine_f1742d() { + float res = fwidth(1.0f); +} + +void vertex_main() { + fwidthFine_f1742d(); + return; +} + +void fragment_main() { + fwidthFine_f1742d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthFine_f1742d(); + return; +} + diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl new file mode 100644 index 0000000000..2e39779fe0 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthFine_f1742d() { + float res = fwidth(1.0f); +} + +vertex void vertex_main() { + fwidthFine_f1742d(); + return; +} + +fragment void fragment_main() { + fwidthFine_f1742d(); + return; +} + +kernel void compute_main() { + fwidthFine_f1742d(); + return; +} + + +tint_WPjnD2.metal:5:9: warning: unused variable 'res' [-Wunused-variable] + float res = fwidth(1.0f); + ^ +tint_WPjnD2.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.f32 is not allowed within a vertex function +tint_WPjnD2.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm new file mode 100644 index 0000000000..8e452ad9ef --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 22 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthFine_f1742d "fwidthFine_f1742d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%fwidthFine_f1742d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpFwidthFine %float %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %14 = OpLabel + OpStore %tint_pointsize %float_1 + %15 = OpFunctionCall %void %fwidthFine_f1742d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %17 = OpLabel + %18 = OpFunctionCall %void %fwidthFine_f1742d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %fwidthFine_f1742d + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '13[%vertex_main]'s callgraph contains function 7[%fwidthFine_f1742d], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthFine + + %fwidthFine_f1742d = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl new file mode 100644 index 0000000000..93e90834e2 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/f1742d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthFine_f1742d() { + var res : f32 = fwidthFine(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_f1742d(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_f1742d(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_f1742d(); +} diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl new file mode 100644 index 0000000000..629a950c2e --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn fwidthFine_ff6aa0() { + var res: vec2 = fwidthFine(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_ff6aa0(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_ff6aa0(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_ff6aa0(); +} diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl new file mode 100644 index 0000000000..f38c96adaf --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void fwidthFine_ff6aa0() { + float2 res = fwidth(float2(0.0f, 0.0f)); +} + +void vertex_main() { + fwidthFine_ff6aa0(); + return; +} + +void fragment_main() { + fwidthFine_ff6aa0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + fwidthFine_ff6aa0(); + return; +} + diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl new file mode 100644 index 0000000000..bb857b73fd --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.msl @@ -0,0 +1,40 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void fwidthFine_ff6aa0() { + float2 res = fwidth(float2()); +} + +vertex void vertex_main() { + fwidthFine_ff6aa0(); + return; +} + +fragment void fragment_main() { + fwidthFine_ff6aa0(); + return; +} + +kernel void compute_main() { + fwidthFine_ff6aa0(); + return; +} + + +tint_YbLbM2.metal:5:10: warning: unused variable 'res' [-Wunused-variable] + float2 res = fwidth(float2()); + ^ +tint_YbLbM2.metal:8:13: error: vertex function 'vertex_main' uses unsupported builtin functions +vertex void vertex_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a vertex function +tint_YbLbM2.metal:18:13: error: kernel function 'compute_main' uses unsupported builtin functions +kernel void compute_main() { + ^ +note: function air.fwidth.v2f32 is not allowed within a kernel function +1 warning and 2 errors generated. diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm new file mode 100644 index 0000000000..eb2f5d8be2 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpCapability DerivativeControl + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %fwidthFine_ff6aa0 "fwidthFine_ff6aa0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %11 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%fwidthFine_ff6aa0 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %11 + %9 = OpFwidthFine %v2float %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %fwidthFine_ff6aa0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %fwidthFine_ff6aa0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %fwidthFine_ff6aa0 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpEntryPoint Entry Point '14[%vertex_main]'s callgraph contains function 7[%fwidthFine_ff6aa0], which cannot be used with the current execution model: +Derivative instructions require Fragment or GLCompute execution model: FwidthFine + + %fwidthFine_ff6aa0 = OpFunction %void None %5 + diff --git a/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl new file mode 100644 index 0000000000..4d0bcb60b2 --- /dev/null +++ b/test/intrinsics/gen/fwidthFine/ff6aa0.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn fwidthFine_ff6aa0() { + var res : vec2 = fwidthFine(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + fwidthFine_ff6aa0(); +} + +[[stage(fragment)]] +fn fragment_main() { + fwidthFine_ff6aa0(); +} + +[[stage(compute)]] +fn compute_main() { + fwidthFine_ff6aa0(); +} diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl new file mode 100644 index 0000000000..070d48c5c7 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn inverseSqrt_84407e() { + var res: f32 = inverseSqrt(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_84407e(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_84407e(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_84407e(); +} diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl new file mode 100644 index 0000000000..2a185e9ca4 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void inverseSqrt_84407e() { + float res = rsqrt(1.0f); +} + +void vertex_main() { + inverseSqrt_84407e(); + return; +} + +void fragment_main() { + inverseSqrt_84407e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + inverseSqrt_84407e(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl new file mode 100644 index 0000000000..9e3ec223b2 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void inverseSqrt_84407e() { + float res = rsqrt(1.0f); +} + +vertex void vertex_main() { + inverseSqrt_84407e(); + return; +} + +fragment void fragment_main() { + inverseSqrt_84407e(); + return; +} + +kernel void compute_main() { + inverseSqrt_84407e(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm new file mode 100644 index 0000000000..d00a8e2f84 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %inverseSqrt_84407e "inverseSqrt_84407e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%inverseSqrt_84407e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 InverseSqrt %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %inverseSqrt_84407e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %inverseSqrt_84407e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %inverseSqrt_84407e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl new file mode 100644 index 0000000000..d1a2d35bf2 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/84407e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn inverseSqrt_84407e() { + var res : f32 = inverseSqrt(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_84407e(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_84407e(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_84407e(); +} diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl new file mode 100644 index 0000000000..bb7bd2bf05 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn inverseSqrt_8f2bd2() { + var res: vec2 = inverseSqrt(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_8f2bd2(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_8f2bd2(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_8f2bd2(); +} diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl new file mode 100644 index 0000000000..efa0978d97 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void inverseSqrt_8f2bd2() { + float2 res = rsqrt(float2(0.0f, 0.0f)); +} + +void vertex_main() { + inverseSqrt_8f2bd2(); + return; +} + +void fragment_main() { + inverseSqrt_8f2bd2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + inverseSqrt_8f2bd2(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl new file mode 100644 index 0000000000..15325bc1aa --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void inverseSqrt_8f2bd2() { + float2 res = rsqrt(float2()); +} + +vertex void vertex_main() { + inverseSqrt_8f2bd2(); + return; +} + +fragment void fragment_main() { + inverseSqrt_8f2bd2(); + return; +} + +kernel void compute_main() { + inverseSqrt_8f2bd2(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm new file mode 100644 index 0000000000..9f2fae125d --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %inverseSqrt_8f2bd2 "inverseSqrt_8f2bd2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%inverseSqrt_8f2bd2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 InverseSqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %inverseSqrt_8f2bd2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %inverseSqrt_8f2bd2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %inverseSqrt_8f2bd2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl new file mode 100644 index 0000000000..496ae2363c --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/8f2bd2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn inverseSqrt_8f2bd2() { + var res : vec2 = inverseSqrt(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_8f2bd2(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_8f2bd2(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_8f2bd2(); +} diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl new file mode 100644 index 0000000000..dda36270ac --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn inverseSqrt_b197b1() { + var res: vec3 = inverseSqrt(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_b197b1(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_b197b1(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_b197b1(); +} diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl new file mode 100644 index 0000000000..3f411b9d0f --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void inverseSqrt_b197b1() { + float3 res = rsqrt(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + inverseSqrt_b197b1(); + return; +} + +void fragment_main() { + inverseSqrt_b197b1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + inverseSqrt_b197b1(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl new file mode 100644 index 0000000000..4fecada513 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void inverseSqrt_b197b1() { + float3 res = rsqrt(float3()); +} + +vertex void vertex_main() { + inverseSqrt_b197b1(); + return; +} + +fragment void fragment_main() { + inverseSqrt_b197b1(); + return; +} + +kernel void compute_main() { + inverseSqrt_b197b1(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm new file mode 100644 index 0000000000..2d8c81c6dd --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %inverseSqrt_b197b1 "inverseSqrt_b197b1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%inverseSqrt_b197b1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 InverseSqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %inverseSqrt_b197b1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %inverseSqrt_b197b1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %inverseSqrt_b197b1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl new file mode 100644 index 0000000000..0025c3461a --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/b197b1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn inverseSqrt_b197b1() { + var res : vec3 = inverseSqrt(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_b197b1(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_b197b1(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_b197b1(); +} diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl new file mode 100644 index 0000000000..35a6a147c4 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn inverseSqrt_c22347() { + var res: vec4 = inverseSqrt(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_c22347(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_c22347(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_c22347(); +} diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl new file mode 100644 index 0000000000..28b66a7eec --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void inverseSqrt_c22347() { + float4 res = rsqrt(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + inverseSqrt_c22347(); + return; +} + +void fragment_main() { + inverseSqrt_c22347(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + inverseSqrt_c22347(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl new file mode 100644 index 0000000000..a8f49dab2c --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void inverseSqrt_c22347() { + float4 res = rsqrt(float4()); +} + +vertex void vertex_main() { + inverseSqrt_c22347(); + return; +} + +fragment void fragment_main() { + inverseSqrt_c22347(); + return; +} + +kernel void compute_main() { + inverseSqrt_c22347(); + return; +} + diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm new file mode 100644 index 0000000000..55bfc4861b --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %inverseSqrt_c22347 "inverseSqrt_c22347" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%inverseSqrt_c22347 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 InverseSqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %inverseSqrt_c22347 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %inverseSqrt_c22347 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %inverseSqrt_c22347 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl new file mode 100644 index 0000000000..268014fff6 --- /dev/null +++ b/test/intrinsics/gen/inverseSqrt/c22347.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn inverseSqrt_c22347() { + var res : vec4 = inverseSqrt(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + inverseSqrt_c22347(); +} + +[[stage(fragment)]] +fn fragment_main() { + inverseSqrt_c22347(); +} + +[[stage(compute)]] +fn compute_main() { + inverseSqrt_c22347(); +} diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl new file mode 100644 index 0000000000..f156dafa2a --- /dev/null +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isFinite_34d32b() { + var res: vec2 = isFinite(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_34d32b(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_34d32b(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_34d32b(); +} diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl new file mode 100644 index 0000000000..e700d05490 --- /dev/null +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isFinite_34d32b() { + vector res = isfinite(float2(0.0f, 0.0f)); +} + +void vertex_main() { + isFinite_34d32b(); + return; +} + +void fragment_main() { + isFinite_34d32b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isFinite_34d32b(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl new file mode 100644 index 0000000000..575853781d --- /dev/null +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isFinite_34d32b() { + bool2 res = isfinite(float2()); +} + +vertex void vertex_main() { + isFinite_34d32b(); + return; +} + +fragment void fragment_main() { + isFinite_34d32b(); + return; +} + +kernel void compute_main() { + isFinite_34d32b(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm new file mode 100644 index 0000000000..12d350111d --- /dev/null +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.spvasm @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isFinite_34d32b "isFinite_34d32b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_v2bool = OpTypePointer Function %v2bool + %19 = OpConstantNull %v2bool + %float_1 = OpConstant %float 1 +%isFinite_34d32b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %19 + %14 = OpIsInf %v2bool %13 + %15 = OpIsNan %v2bool %13 + %16 = OpLogicalOr %v2bool %14 %15 + %9 = OpLogicalNot %v2bool %16 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %isFinite_34d32b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isFinite_34d32b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %28 = OpLabel + %29 = OpFunctionCall %void %isFinite_34d32b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl new file mode 100644 index 0000000000..a50f43c66d --- /dev/null +++ b/test/intrinsics/gen/isFinite/34d32b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isFinite_34d32b() { + var res : vec2 = isFinite(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_34d32b(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_34d32b(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_34d32b(); +} diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl new file mode 100644 index 0000000000..72f866bbc2 --- /dev/null +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isFinite_426f9f() { + var res: bool = isFinite(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_426f9f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_426f9f(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_426f9f(); +} diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl new file mode 100644 index 0000000000..83b92bff20 --- /dev/null +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isFinite_426f9f() { + bool res = isfinite(1.0f); +} + +void vertex_main() { + isFinite_426f9f(); + return; +} + +void fragment_main() { + isFinite_426f9f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isFinite_426f9f(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl new file mode 100644 index 0000000000..27e7955b69 --- /dev/null +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isFinite_426f9f() { + bool res = isfinite(1.0f); +} + +vertex void vertex_main() { + isFinite_426f9f(); + return; +} + +fragment void fragment_main() { + isFinite_426f9f(); + return; +} + +kernel void compute_main() { + isFinite_426f9f(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm new file mode 100644 index 0000000000..cca76055eb --- /dev/null +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isFinite_426f9f "isFinite_426f9f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %float_1 = OpConstant %float 1 +%_ptr_Function_bool = OpTypePointer Function %bool + %17 = OpConstantNull %bool +%isFinite_426f9f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %17 + %12 = OpIsInf %bool %float_1 + %13 = OpIsNan %bool %float_1 + %14 = OpLogicalOr %bool %12 %13 + %9 = OpLogicalNot %bool %14 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isFinite_426f9f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isFinite_426f9f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isFinite_426f9f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl new file mode 100644 index 0000000000..458d18fd50 --- /dev/null +++ b/test/intrinsics/gen/isFinite/426f9f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isFinite_426f9f() { + var res : bool = isFinite(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_426f9f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_426f9f(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_426f9f(); +} diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl new file mode 100644 index 0000000000..06f16937b0 --- /dev/null +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isFinite_8a23ad() { + var res: vec3 = isFinite(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_8a23ad(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_8a23ad(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_8a23ad(); +} diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl new file mode 100644 index 0000000000..b8915539fb --- /dev/null +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isFinite_8a23ad() { + vector res = isfinite(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isFinite_8a23ad(); + return; +} + +void fragment_main() { + isFinite_8a23ad(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isFinite_8a23ad(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl new file mode 100644 index 0000000000..3bfe1d389d --- /dev/null +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isFinite_8a23ad() { + bool3 res = isfinite(float3()); +} + +vertex void vertex_main() { + isFinite_8a23ad(); + return; +} + +fragment void fragment_main() { + isFinite_8a23ad(); + return; +} + +kernel void compute_main() { + isFinite_8a23ad(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm new file mode 100644 index 0000000000..45f72cf868 --- /dev/null +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.spvasm @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isFinite_8a23ad "isFinite_8a23ad" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %v3float = OpTypeVector %float 3 + %13 = OpConstantNull %v3float +%_ptr_Function_v3bool = OpTypePointer Function %v3bool + %19 = OpConstantNull %v3bool + %float_1 = OpConstant %float 1 +%isFinite_8a23ad = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %19 + %14 = OpIsInf %v3bool %13 + %15 = OpIsNan %v3bool %13 + %16 = OpLogicalOr %v3bool %14 %15 + %9 = OpLogicalNot %v3bool %16 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %isFinite_8a23ad + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isFinite_8a23ad + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %28 = OpLabel + %29 = OpFunctionCall %void %isFinite_8a23ad + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl new file mode 100644 index 0000000000..1cb9665aa0 --- /dev/null +++ b/test/intrinsics/gen/isFinite/8a23ad.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isFinite_8a23ad() { + var res : vec3 = isFinite(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_8a23ad(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_8a23ad(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_8a23ad(); +} diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl new file mode 100644 index 0000000000..9747c63348 --- /dev/null +++ b/test/intrinsics/gen/isFinite/f31987.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isFinite_f31987() { + var res: vec4 = isFinite(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_f31987(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_f31987(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_f31987(); +} diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl new file mode 100644 index 0000000000..6e9a1af07f --- /dev/null +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isFinite_f31987() { + vector res = isfinite(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isFinite_f31987(); + return; +} + +void fragment_main() { + isFinite_f31987(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isFinite_f31987(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl new file mode 100644 index 0000000000..f8184b31c4 --- /dev/null +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isFinite_f31987() { + bool4 res = isfinite(float4()); +} + +vertex void vertex_main() { + isFinite_f31987(); + return; +} + +fragment void fragment_main() { + isFinite_f31987(); + return; +} + +kernel void compute_main() { + isFinite_f31987(); + return; +} + diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm new file mode 100644 index 0000000000..20008cb7ee --- /dev/null +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.spvasm @@ -0,0 +1,58 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isFinite_f31987 "isFinite_f31987" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float +%_ptr_Function_v4bool = OpTypePointer Function %v4bool + %19 = OpConstantNull %v4bool + %float_1 = OpConstant %float 1 +%isFinite_f31987 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %19 + %14 = OpIsInf %v4bool %13 + %15 = OpIsNan %v4bool %13 + %16 = OpLogicalOr %v4bool %14 %15 + %9 = OpLogicalNot %v4bool %16 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %isFinite_f31987 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isFinite_f31987 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %28 = OpLabel + %29 = OpFunctionCall %void %isFinite_f31987 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl new file mode 100644 index 0000000000..63c77f5fe8 --- /dev/null +++ b/test/intrinsics/gen/isFinite/f31987.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isFinite_f31987() { + var res : vec4 = isFinite(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isFinite_f31987(); +} + +[[stage(fragment)]] +fn fragment_main() { + isFinite_f31987(); +} + +[[stage(compute)]] +fn compute_main() { + isFinite_f31987(); +} diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl new file mode 100644 index 0000000000..fb0708cc53 --- /dev/null +++ b/test/intrinsics/gen/isInf/666f2a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isInf_666f2a() { + var res: vec3 = isInf(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_666f2a(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_666f2a(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_666f2a(); +} diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl new file mode 100644 index 0000000000..70986264f3 --- /dev/null +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isInf_666f2a() { + vector res = isinf(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isInf_666f2a(); + return; +} + +void fragment_main() { + isInf_666f2a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isInf_666f2a(); + return; +} + diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl new file mode 100644 index 0000000000..f2f6709d2b --- /dev/null +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isInf_666f2a() { + bool3 res = isinf(float3()); +} + +vertex void vertex_main() { + isInf_666f2a(); + return; +} + +fragment void fragment_main() { + isInf_666f2a(); + return; +} + +kernel void compute_main() { + isInf_666f2a(); + return; +} + diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm new file mode 100644 index 0000000000..b42d0f5933 --- /dev/null +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isInf_666f2a "isInf_666f2a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %v3float = OpTypeVector %float 3 + %13 = OpConstantNull %v3float +%_ptr_Function_v3bool = OpTypePointer Function %v3bool + %16 = OpConstantNull %v3bool + %float_1 = OpConstant %float 1 +%isInf_666f2a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %16 + %9 = OpIsInf %v3bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isInf_666f2a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isInf_666f2a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isInf_666f2a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl new file mode 100644 index 0000000000..aaf35df22f --- /dev/null +++ b/test/intrinsics/gen/isInf/666f2a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isInf_666f2a() { + var res : vec3 = isInf(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_666f2a(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_666f2a(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_666f2a(); +} diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl new file mode 100644 index 0000000000..a6598566be --- /dev/null +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isInf_7bd98f() { + var res: bool = isInf(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_7bd98f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_7bd98f(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_7bd98f(); +} diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl new file mode 100644 index 0000000000..bb7d9757da --- /dev/null +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isInf_7bd98f() { + bool res = isinf(1.0f); +} + +void vertex_main() { + isInf_7bd98f(); + return; +} + +void fragment_main() { + isInf_7bd98f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isInf_7bd98f(); + return; +} + diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl new file mode 100644 index 0000000000..8623d0e0a9 --- /dev/null +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isInf_7bd98f() { + bool res = isinf(1.0f); +} + +vertex void vertex_main() { + isInf_7bd98f(); + return; +} + +fragment void fragment_main() { + isInf_7bd98f(); + return; +} + +kernel void compute_main() { + isInf_7bd98f(); + return; +} + diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm new file mode 100644 index 0000000000..361f0f8776 --- /dev/null +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isInf_7bd98f "isInf_7bd98f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %float_1 = OpConstant %float 1 +%_ptr_Function_bool = OpTypePointer Function %bool + %14 = OpConstantNull %bool +%isInf_7bd98f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %14 + %9 = OpIsInf %bool %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %isInf_7bd98f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %isInf_7bd98f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isInf_7bd98f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl new file mode 100644 index 0000000000..1fe501e548 --- /dev/null +++ b/test/intrinsics/gen/isInf/7bd98f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isInf_7bd98f() { + var res : bool = isInf(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_7bd98f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_7bd98f(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_7bd98f(); +} diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl new file mode 100644 index 0000000000..7462bd29f4 --- /dev/null +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isInf_7e81b5() { + var res: vec4 = isInf(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_7e81b5(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_7e81b5(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_7e81b5(); +} diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl new file mode 100644 index 0000000000..00db4f3666 --- /dev/null +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isInf_7e81b5() { + vector res = isinf(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isInf_7e81b5(); + return; +} + +void fragment_main() { + isInf_7e81b5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isInf_7e81b5(); + return; +} + diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl new file mode 100644 index 0000000000..331e462e93 --- /dev/null +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isInf_7e81b5() { + bool4 res = isinf(float4()); +} + +vertex void vertex_main() { + isInf_7e81b5(); + return; +} + +fragment void fragment_main() { + isInf_7e81b5(); + return; +} + +kernel void compute_main() { + isInf_7e81b5(); + return; +} + diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm new file mode 100644 index 0000000000..8fc9a10b54 --- /dev/null +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isInf_7e81b5 "isInf_7e81b5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float +%_ptr_Function_v4bool = OpTypePointer Function %v4bool + %16 = OpConstantNull %v4bool + %float_1 = OpConstant %float 1 +%isInf_7e81b5 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %16 + %9 = OpIsInf %v4bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isInf_7e81b5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isInf_7e81b5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isInf_7e81b5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl new file mode 100644 index 0000000000..749e65337a --- /dev/null +++ b/test/intrinsics/gen/isInf/7e81b5.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isInf_7e81b5() { + var res : vec4 = isInf(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_7e81b5(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_7e81b5(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_7e81b5(); +} diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl new file mode 100644 index 0000000000..336593b539 --- /dev/null +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isInf_a46d6f() { + var res: vec2 = isInf(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_a46d6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_a46d6f(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_a46d6f(); +} diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl new file mode 100644 index 0000000000..dd76a70849 --- /dev/null +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isInf_a46d6f() { + vector res = isinf(float2(0.0f, 0.0f)); +} + +void vertex_main() { + isInf_a46d6f(); + return; +} + +void fragment_main() { + isInf_a46d6f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isInf_a46d6f(); + return; +} + diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl new file mode 100644 index 0000000000..41925dec17 --- /dev/null +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isInf_a46d6f() { + bool2 res = isinf(float2()); +} + +vertex void vertex_main() { + isInf_a46d6f(); + return; +} + +fragment void fragment_main() { + isInf_a46d6f(); + return; +} + +kernel void compute_main() { + isInf_a46d6f(); + return; +} + diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm new file mode 100644 index 0000000000..5b3fe9b68f --- /dev/null +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isInf_a46d6f "isInf_a46d6f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_v2bool = OpTypePointer Function %v2bool + %16 = OpConstantNull %v2bool + %float_1 = OpConstant %float 1 +%isInf_a46d6f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %16 + %9 = OpIsInf %v2bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isInf_a46d6f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isInf_a46d6f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isInf_a46d6f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl new file mode 100644 index 0000000000..0166b73982 --- /dev/null +++ b/test/intrinsics/gen/isInf/a46d6f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isInf_a46d6f() { + var res : vec2 = isInf(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isInf_a46d6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + isInf_a46d6f(); +} + +[[stage(compute)]] +fn compute_main() { + isInf_a46d6f(); +} diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl new file mode 100644 index 0000000000..5297e910a4 --- /dev/null +++ b/test/intrinsics/gen/isNan/1280ab.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNan_1280ab() { + var res: vec3 = isNan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_1280ab(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_1280ab(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_1280ab(); +} diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl new file mode 100644 index 0000000000..0d6bc82f5f --- /dev/null +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void isNan_1280ab() { + vector res = isnan(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isNan_1280ab(); + return; +} + +void fragment_main() { + isNan_1280ab(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isNan_1280ab(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl new file mode 100644 index 0000000000..c19b61d409 --- /dev/null +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNan_1280ab() { + bool3 res = isnan(float3()); +} + +vertex void vertex_main() { + isNan_1280ab(); + return; +} + +fragment void fragment_main() { + isNan_1280ab(); + return; +} + +kernel void compute_main() { + isNan_1280ab(); + return; +} + diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm new file mode 100644 index 0000000000..f678b423b3 --- /dev/null +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNan_1280ab "isNan_1280ab" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %v3float = OpTypeVector %float 3 + %13 = OpConstantNull %v3float +%_ptr_Function_v3bool = OpTypePointer Function %v3bool + %16 = OpConstantNull %v3bool + %float_1 = OpConstant %float 1 +%isNan_1280ab = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %16 + %9 = OpIsNan %v3bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isNan_1280ab + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isNan_1280ab + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isNan_1280ab + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl new file mode 100644 index 0000000000..4e728d7341 --- /dev/null +++ b/test/intrinsics/gen/isNan/1280ab.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNan_1280ab() { + var res : vec3 = isNan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_1280ab(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_1280ab(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_1280ab(); +} diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl new file mode 100644 index 0000000000..fb64518af2 --- /dev/null +++ b/test/intrinsics/gen/isNan/4d280d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNan_4d280d() { + var res: vec4 = isNan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_4d280d(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_4d280d(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_4d280d(); +} diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl new file mode 100644 index 0000000000..3fed78436d --- /dev/null +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void isNan_4d280d() { + vector res = isnan(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + isNan_4d280d(); + return; +} + +void fragment_main() { + isNan_4d280d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isNan_4d280d(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl new file mode 100644 index 0000000000..3b4b9e5566 --- /dev/null +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNan_4d280d() { + bool4 res = isnan(float4()); +} + +vertex void vertex_main() { + isNan_4d280d(); + return; +} + +fragment void fragment_main() { + isNan_4d280d(); + return; +} + +kernel void compute_main() { + isNan_4d280d(); + return; +} + diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm new file mode 100644 index 0000000000..39e7eddc84 --- /dev/null +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNan_4d280d "isNan_4d280d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float +%_ptr_Function_v4bool = OpTypePointer Function %v4bool + %16 = OpConstantNull %v4bool + %float_1 = OpConstant %float 1 +%isNan_4d280d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %16 + %9 = OpIsNan %v4bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isNan_4d280d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isNan_4d280d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isNan_4d280d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl new file mode 100644 index 0000000000..f0acfc5c63 --- /dev/null +++ b/test/intrinsics/gen/isNan/4d280d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNan_4d280d() { + var res : vec4 = isNan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_4d280d(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_4d280d(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_4d280d(); +} diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl new file mode 100644 index 0000000000..030cd011d6 --- /dev/null +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNan_67ecd3() { + var res: vec2 = isNan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_67ecd3(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_67ecd3(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_67ecd3(); +} diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl new file mode 100644 index 0000000000..9850d57713 --- /dev/null +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.hlsl @@ -0,0 +1,31 @@ +SKIP: FAILED + + + +Validation Failure: +void isNan_67ecd3() { + vector res = isnan(float2(0.0f, 0.0f)); +} + +void vertex_main() { + isNan_67ecd3(); + return; +} + +void fragment_main() { + isNan_67ecd3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isNan_67ecd3(); + return; +} + + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. + +dxc: /build/directxshadercompiler-1.4.0.2274-413-1lunarg18.04/include/llvm/Support/Casting.h:238: typename llvm::cast_retty::ret_type llvm::cast(Y*) [with X = llvm::ConstantFP; Y = llvm::Value; typename llvm::cast_retty::ret_type = llvm::ConstantFP*]: Assertion `isa(Val) && "cast() argument of incompatible type!"' failed. diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl new file mode 100644 index 0000000000..66587ba26b --- /dev/null +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNan_67ecd3() { + bool2 res = isnan(float2()); +} + +vertex void vertex_main() { + isNan_67ecd3(); + return; +} + +fragment void fragment_main() { + isNan_67ecd3(); + return; +} + +kernel void compute_main() { + isNan_67ecd3(); + return; +} + diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm new file mode 100644 index 0000000000..de78ebc15b --- /dev/null +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNan_67ecd3 "isNan_67ecd3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_v2bool = OpTypePointer Function %v2bool + %16 = OpConstantNull %v2bool + %float_1 = OpConstant %float 1 +%isNan_67ecd3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %16 + %9 = OpIsNan %v2bool %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %isNan_67ecd3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isNan_67ecd3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %isNan_67ecd3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl new file mode 100644 index 0000000000..dcdd0deb8a --- /dev/null +++ b/test/intrinsics/gen/isNan/67ecd3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNan_67ecd3() { + var res : vec2 = isNan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_67ecd3(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_67ecd3(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_67ecd3(); +} diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl new file mode 100644 index 0000000000..ca06e2366c --- /dev/null +++ b/test/intrinsics/gen/isNan/e4978e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNan_e4978e() { + var res: bool = isNan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_e4978e(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_e4978e(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_e4978e(); +} diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl new file mode 100644 index 0000000000..cf183f7c96 --- /dev/null +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void isNan_e4978e() { + bool res = isnan(1.0f); +} + +void vertex_main() { + isNan_e4978e(); + return; +} + +void fragment_main() { + isNan_e4978e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + isNan_e4978e(); + return; +} + diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl new file mode 100644 index 0000000000..b308160c0e --- /dev/null +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNan_e4978e() { + bool res = isnan(1.0f); +} + +vertex void vertex_main() { + isNan_e4978e(); + return; +} + +fragment void fragment_main() { + isNan_e4978e(); + return; +} + +kernel void compute_main() { + isNan_e4978e(); + return; +} + diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm new file mode 100644 index 0000000000..c8cf7ca528 --- /dev/null +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNan_e4978e "isNan_e4978e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %float_1 = OpConstant %float 1 +%_ptr_Function_bool = OpTypePointer Function %bool + %14 = OpConstantNull %bool +%isNan_e4978e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %14 + %9 = OpIsNan %bool %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %isNan_e4978e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %isNan_e4978e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %isNan_e4978e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl new file mode 100644 index 0000000000..ecdc24f885 --- /dev/null +++ b/test/intrinsics/gen/isNan/e4978e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNan_e4978e() { + var res : bool = isNan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isNan_e4978e(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNan_e4978e(); +} + +[[stage(compute)]] +fn compute_main() { + isNan_e4978e(); +} diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl new file mode 100644 index 0000000000..7098af1691 --- /dev/null +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNormal_863dcd() { + var res: vec4 = isNormal(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_863dcd(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_863dcd(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_863dcd(); +} diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl new file mode 100644 index 0000000000..b4a5d837cd --- /dev/null +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn isNormal_863dcd() { + var res : vec4 = isNormal(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_863dcd(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_863dcd(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_863dcd(); +} + +Failed to generate: error: is_normal not supported in HLSL backend yet diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl new file mode 100644 index 0000000000..864e4ef005 --- /dev/null +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNormal_863dcd() { + bool4 res = isnormal(float4()); +} + +vertex void vertex_main() { + isNormal_863dcd(); + return; +} + +fragment void fragment_main() { + isNormal_863dcd(); + return; +} + +kernel void compute_main() { + isNormal_863dcd(); + return; +} + diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm new file mode 100644 index 0000000000..9d47ef5e1b --- /dev/null +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.spvasm @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNormal_863dcd "isNormal_863dcd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float + %uint = OpTypeInt 32 0 +%uint_133693440 = OpConstant %uint 133693440 +%uint_524288 = OpConstant %uint 524288 +%uint_133169152 = OpConstant %uint 133169152 + %v4uint = OpTypeVector %uint 4 +%_ptr_Function_v4bool = OpTypePointer Function %v4bool + %28 = OpConstantNull %v4bool + %float_1 = OpConstant %float 1 +%isNormal_863dcd = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %28 + %20 = OpCompositeConstruct %v4uint %uint_133693440 %uint_133693440 %uint_133693440 %uint_133693440 + %21 = OpCompositeConstruct %v4uint %uint_524288 %uint_524288 %uint_524288 %uint_524288 + %22 = OpCompositeConstruct %v4uint %uint_133169152 %uint_133169152 %uint_133169152 %uint_133169152 + %23 = OpBitcast %v4uint %13 + %24 = OpBitwiseAnd %v4uint %23 %20 + %25 = OpExtInst %v4uint %14 UClamp %24 %21 %22 + %9 = OpIEqual %v4bool %24 %25 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %isNormal_863dcd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %34 = OpLabel + %35 = OpFunctionCall %void %isNormal_863dcd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %37 = OpLabel + %38 = OpFunctionCall %void %isNormal_863dcd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl new file mode 100644 index 0000000000..f81cfef5e3 --- /dev/null +++ b/test/intrinsics/gen/isNormal/863dcd.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNormal_863dcd() { + var res : vec4 = isNormal(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_863dcd(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_863dcd(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_863dcd(); +} diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl new file mode 100644 index 0000000000..cb819a6868 --- /dev/null +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNormal_b00ab1() { + var res: vec2 = isNormal(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_b00ab1(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_b00ab1(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_b00ab1(); +} diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl new file mode 100644 index 0000000000..c6bca5c9ef --- /dev/null +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn isNormal_b00ab1() { + var res : vec2 = isNormal(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_b00ab1(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_b00ab1(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_b00ab1(); +} + +Failed to generate: error: is_normal not supported in HLSL backend yet diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl new file mode 100644 index 0000000000..8f1c9dd707 --- /dev/null +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNormal_b00ab1() { + bool2 res = isnormal(float2()); +} + +vertex void vertex_main() { + isNormal_b00ab1(); + return; +} + +fragment void fragment_main() { + isNormal_b00ab1(); + return; +} + +kernel void compute_main() { + isNormal_b00ab1(); + return; +} + diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm new file mode 100644 index 0000000000..392e6274aa --- /dev/null +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.spvasm @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNormal_b00ab1 "isNormal_b00ab1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float + %uint = OpTypeInt 32 0 +%uint_133693440 = OpConstant %uint 133693440 +%uint_524288 = OpConstant %uint 524288 +%uint_133169152 = OpConstant %uint 133169152 + %v2uint = OpTypeVector %uint 2 +%_ptr_Function_v2bool = OpTypePointer Function %v2bool + %28 = OpConstantNull %v2bool + %float_1 = OpConstant %float 1 +%isNormal_b00ab1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %28 + %20 = OpCompositeConstruct %v2uint %uint_133693440 %uint_133693440 + %21 = OpCompositeConstruct %v2uint %uint_524288 %uint_524288 + %22 = OpCompositeConstruct %v2uint %uint_133169152 %uint_133169152 + %23 = OpBitcast %v2uint %13 + %24 = OpBitwiseAnd %v2uint %23 %20 + %25 = OpExtInst %v2uint %14 UClamp %24 %21 %22 + %9 = OpIEqual %v2bool %24 %25 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %isNormal_b00ab1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %34 = OpLabel + %35 = OpFunctionCall %void %isNormal_b00ab1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %37 = OpLabel + %38 = OpFunctionCall %void %isNormal_b00ab1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl new file mode 100644 index 0000000000..c14e06d70e --- /dev/null +++ b/test/intrinsics/gen/isNormal/b00ab1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNormal_b00ab1() { + var res : vec2 = isNormal(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_b00ab1(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_b00ab1(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_b00ab1(); +} diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl new file mode 100644 index 0000000000..50c11aae0b --- /dev/null +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNormal_c286b7() { + var res: vec3 = isNormal(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c286b7(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c286b7(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c286b7(); +} diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl new file mode 100644 index 0000000000..1522bbb086 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn isNormal_c286b7() { + var res : vec3 = isNormal(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c286b7(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c286b7(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c286b7(); +} + +Failed to generate: error: is_normal not supported in HLSL backend yet diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl new file mode 100644 index 0000000000..26fc3c4c76 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNormal_c286b7() { + bool3 res = isnormal(float3()); +} + +vertex void vertex_main() { + isNormal_c286b7(); + return; +} + +fragment void fragment_main() { + isNormal_c286b7(); + return; +} + +kernel void compute_main() { + isNormal_c286b7(); + return; +} + diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm new file mode 100644 index 0000000000..4ae8199242 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.spvasm @@ -0,0 +1,67 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNormal_c286b7 "isNormal_c286b7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %v3float = OpTypeVector %float 3 + %13 = OpConstantNull %v3float + %uint = OpTypeInt 32 0 +%uint_133693440 = OpConstant %uint 133693440 +%uint_524288 = OpConstant %uint 524288 +%uint_133169152 = OpConstant %uint 133169152 + %v3uint = OpTypeVector %uint 3 +%_ptr_Function_v3bool = OpTypePointer Function %v3bool + %28 = OpConstantNull %v3bool + %float_1 = OpConstant %float 1 +%isNormal_c286b7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %28 + %20 = OpCompositeConstruct %v3uint %uint_133693440 %uint_133693440 %uint_133693440 + %21 = OpCompositeConstruct %v3uint %uint_524288 %uint_524288 %uint_524288 + %22 = OpCompositeConstruct %v3uint %uint_133169152 %uint_133169152 %uint_133169152 + %23 = OpBitcast %v3uint %13 + %24 = OpBitwiseAnd %v3uint %23 %20 + %25 = OpExtInst %v3uint %14 UClamp %24 %21 %22 + %9 = OpIEqual %v3bool %24 %25 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %isNormal_c286b7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %34 = OpLabel + %35 = OpFunctionCall %void %isNormal_c286b7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %37 = OpLabel + %38 = OpFunctionCall %void %isNormal_c286b7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl new file mode 100644 index 0000000000..e8b0e2bb17 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c286b7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNormal_c286b7() { + var res : vec3 = isNormal(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c286b7(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c286b7(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c286b7(); +} diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl new file mode 100644 index 0000000000..9997d8c09b --- /dev/null +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn isNormal_c6e880() { + var res: bool = isNormal(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c6e880(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c6e880(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c6e880(); +} diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl new file mode 100644 index 0000000000..c6a86acde7 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn isNormal_c6e880() { + var res : bool = isNormal(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c6e880(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c6e880(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c6e880(); +} + +Failed to generate: error: is_normal not supported in HLSL backend yet diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl new file mode 100644 index 0000000000..b8dda4e688 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void isNormal_c6e880() { + bool res = isnormal(1.0f); +} + +vertex void vertex_main() { + isNormal_c6e880(); + return; +} + +fragment void fragment_main() { + isNormal_c6e880(); + return; +} + +kernel void compute_main() { + isNormal_c6e880(); + return; +} + diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm new file mode 100644 index 0000000000..85f21bbc39 --- /dev/null +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %isNormal_c6e880 "isNormal_c6e880" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %float_1 = OpConstant %float 1 + %uint = OpTypeInt 32 0 +%uint_133693440 = OpConstant %uint 133693440 +%uint_524288 = OpConstant %uint 524288 +%uint_133169152 = OpConstant %uint 133169152 +%_ptr_Function_bool = OpTypePointer Function %bool + %22 = OpConstantNull %bool +%isNormal_c6e880 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %22 + %17 = OpBitcast %uint %float_1 + %18 = OpBitwiseAnd %uint %17 %uint_133693440 + %19 = OpExtInst %uint %12 UClamp %18 %uint_524288 %uint_133169152 + %9 = OpIEqual %bool %18 %19 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %isNormal_c6e880 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %27 = OpLabel + %28 = OpFunctionCall %void %isNormal_c6e880 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %30 = OpLabel + %31 = OpFunctionCall %void %isNormal_c6e880 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl new file mode 100644 index 0000000000..5218aec46e --- /dev/null +++ b/test/intrinsics/gen/isNormal/c6e880.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn isNormal_c6e880() { + var res : bool = isNormal(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + isNormal_c6e880(); +} + +[[stage(fragment)]] +fn fragment_main() { + isNormal_c6e880(); +} + +[[stage(compute)]] +fn compute_main() { + isNormal_c6e880(); +} diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl new file mode 100644 index 0000000000..46ca343674 --- /dev/null +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_2cb32a() { + var res: vec3 = ldexp(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_2cb32a(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_2cb32a(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_2cb32a(); +} diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl new file mode 100644 index 0000000000..60b2ca18fb --- /dev/null +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_2cb32a() { + float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), uint3(0u, 0u, 0u)); +} + +void vertex_main() { + ldexp_2cb32a(); + return; +} + +void fragment_main() { + ldexp_2cb32a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_2cb32a(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl new file mode 100644 index 0000000000..da7795824a --- /dev/null +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.msl @@ -0,0 +1,56 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void ldexp_2cb32a() { + float3 res = ldexp(float3(), uint3()); +} + +vertex void vertex_main() { + ldexp_2cb32a(); + return; +} + +fragment void fragment_main() { + ldexp_2cb32a(); + return; +} + +kernel void compute_main() { + ldexp_2cb32a(); + return; +} + + +tint_UUwNAv.metal:5:18: error: no matching function for call to 'ldexp' + float3 res = ldexp(float3(), uint3()); + ^~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'uint3' (vector of 3 'unsigned int' values) to 'metal::int3' (aka 'int3') for 2nd argument +METAL_FUNC float3 ldexp(float3 x, int3 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'half' for 1st argument +METAL_FUNC half ldexp(half x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half2' (aka 'half2') for 1st argument +METAL_FUNC half2 ldexp(half2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half3' (aka 'half3') for 1st argument +METAL_FUNC half3 ldexp(half3 x, int3 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::half4' (aka 'half4') for 1st argument +METAL_FUNC half4 ldexp(half4 x, int4 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'float' for 1st argument +METAL_FUNC float ldexp(float x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float2' (aka 'float2') for 1st argument +METAL_FUNC float2 ldexp(float2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'float3' (vector of 3 'float' values) to 'metal::float4' (aka 'float4') for 1st argument +METAL_FUNC float4 ldexp(float4 x, int4 k) + ^ +1 error generated. diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm new file mode 100644 index 0000000000..7d726b1bd8 --- /dev/null +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_2cb32a "ldexp_2cb32a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %15 = OpConstantNull %v3uint +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%ldexp_2cb32a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_2cb32a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_2cb32a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_2cb32a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl new file mode 100644 index 0000000000..7a2d880bc0 --- /dev/null +++ b/test/intrinsics/gen/ldexp/2cb32a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_2cb32a() { + var res : vec3 = ldexp(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_2cb32a(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_2cb32a(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_2cb32a(); +} diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl new file mode 100644 index 0000000000..721a215624 --- /dev/null +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_4d6f6d() { + var res: vec4 = ldexp(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_4d6f6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_4d6f6d(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_4d6f6d(); +} diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl new file mode 100644 index 0000000000..34a11dc741 --- /dev/null +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_4d6f6d() { + float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + ldexp_4d6f6d(); + return; +} + +void fragment_main() { + ldexp_4d6f6d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_4d6f6d(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl new file mode 100644 index 0000000000..f65466e4de --- /dev/null +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.msl @@ -0,0 +1,56 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void ldexp_4d6f6d() { + float4 res = ldexp(float4(), uint4()); +} + +vertex void vertex_main() { + ldexp_4d6f6d(); + return; +} + +fragment void fragment_main() { + ldexp_4d6f6d(); + return; +} + +kernel void compute_main() { + ldexp_4d6f6d(); + return; +} + + +tint_51Pgfs.metal:5:18: error: no matching function for call to 'ldexp' + float4 res = ldexp(float4(), uint4()); + ^~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'uint4' (vector of 4 'unsigned int' values) to 'metal::int4' (aka 'int4') for 2nd argument +METAL_FUNC float4 ldexp(float4 x, int4 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'half' for 1st argument +METAL_FUNC half ldexp(half x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half2' (aka 'half2') for 1st argument +METAL_FUNC half2 ldexp(half2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half3' (aka 'half3') for 1st argument +METAL_FUNC half3 ldexp(half3 x, int3 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::half4' (aka 'half4') for 1st argument +METAL_FUNC half4 ldexp(half4 x, int4 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'float' for 1st argument +METAL_FUNC float ldexp(float x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float2' (aka 'float2') for 1st argument +METAL_FUNC float2 ldexp(float2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'float4' (vector of 4 'float' values) to 'metal::float3' (aka 'float3') for 1st argument +METAL_FUNC float3 ldexp(float3 x, int3 k) + ^ +1 error generated. diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm new file mode 100644 index 0000000000..15284e6e39 --- /dev/null +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_4d6f6d "ldexp_4d6f6d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %15 = OpConstantNull %v4uint +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%ldexp_4d6f6d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_4d6f6d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_4d6f6d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_4d6f6d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl new file mode 100644 index 0000000000..50dc3073fb --- /dev/null +++ b/test/intrinsics/gen/ldexp/4d6f6d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_4d6f6d() { + var res : vec4 = ldexp(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_4d6f6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_4d6f6d(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_4d6f6d(); +} diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl new file mode 100644 index 0000000000..f3de6a9081 --- /dev/null +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_7bc2fd() { + var res: vec2 = ldexp(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_7bc2fd(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_7bc2fd(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_7bc2fd(); +} diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl new file mode 100644 index 0000000000..b5ec607bae --- /dev/null +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_7bc2fd() { + float2 res = ldexp(float2(0.0f, 0.0f), uint2(0u, 0u)); +} + +void vertex_main() { + ldexp_7bc2fd(); + return; +} + +void fragment_main() { + ldexp_7bc2fd(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_7bc2fd(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl new file mode 100644 index 0000000000..940c23200d --- /dev/null +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.msl @@ -0,0 +1,56 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void ldexp_7bc2fd() { + float2 res = ldexp(float2(), uint2()); +} + +vertex void vertex_main() { + ldexp_7bc2fd(); + return; +} + +fragment void fragment_main() { + ldexp_7bc2fd(); + return; +} + +kernel void compute_main() { + ldexp_7bc2fd(); + return; +} + + +tint_aJWI1V.metal:5:18: error: no matching function for call to 'ldexp' + float2 res = ldexp(float2(), uint2()); + ^~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3336:19: note: candidate function not viable: no known conversion from 'uint2' (vector of 2 'unsigned int' values) to 'metal::int2' (aka 'int2') for 2nd argument +METAL_FUNC float2 ldexp(float2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2116:17: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'half' for 1st argument +METAL_FUNC half ldexp(half x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2360:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half2' (aka 'half2') for 1st argument +METAL_FUNC half2 ldexp(half2 x, int2 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2604:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half3' (aka 'half3') for 1st argument +METAL_FUNC half3 ldexp(half3 x, int3 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:2848:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::half4' (aka 'half4') for 1st argument +METAL_FUNC half4 ldexp(half4 x, int4 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3092:18: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'float' for 1st argument +METAL_FUNC float ldexp(float x, int k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3580:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float3' (aka 'float3') for 1st argument +METAL_FUNC float3 ldexp(float3 x, int3 k) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_math:3824:19: note: candidate function not viable: no known conversion from 'float2' (vector of 2 'float' values) to 'metal::float4' (aka 'float4') for 1st argument +METAL_FUNC float4 ldexp(float4 x, int4 k) + ^ +1 error generated. diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm new file mode 100644 index 0000000000..e91a0d41ae --- /dev/null +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_7bc2fd "ldexp_7bc2fd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %15 = OpConstantNull %v2uint +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%ldexp_7bc2fd = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_7bc2fd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_7bc2fd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_7bc2fd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl new file mode 100644 index 0000000000..3f6c48ec50 --- /dev/null +++ b/test/intrinsics/gen/ldexp/7bc2fd.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_7bc2fd() { + var res : vec2 = ldexp(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_7bc2fd(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_7bc2fd(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_7bc2fd(); +} diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl new file mode 100644 index 0000000000..54dd6900c0 --- /dev/null +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_a31cdc() { + var res: vec3 = ldexp(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_a31cdc(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_a31cdc(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_a31cdc(); +} diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl new file mode 100644 index 0000000000..a099927b12 --- /dev/null +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_a31cdc() { + float3 res = ldexp(float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0)); +} + +void vertex_main() { + ldexp_a31cdc(); + return; +} + +void fragment_main() { + ldexp_a31cdc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_a31cdc(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl new file mode 100644 index 0000000000..a535583d9f --- /dev/null +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ldexp_a31cdc() { + float3 res = ldexp(float3(), int3()); +} + +vertex void vertex_main() { + ldexp_a31cdc(); + return; +} + +fragment void fragment_main() { + ldexp_a31cdc(); + return; +} + +kernel void compute_main() { + ldexp_a31cdc(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm new file mode 100644 index 0000000000..07a38ebeda --- /dev/null +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_a31cdc "ldexp_a31cdc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %15 = OpConstantNull %v3int +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%ldexp_a31cdc = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_a31cdc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_a31cdc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_a31cdc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl new file mode 100644 index 0000000000..788cab232a --- /dev/null +++ b/test/intrinsics/gen/ldexp/a31cdc.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_a31cdc() { + var res : vec3 = ldexp(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_a31cdc(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_a31cdc(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_a31cdc(); +} diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl new file mode 100644 index 0000000000..7a5eef17db --- /dev/null +++ b/test/intrinsics/gen/ldexp/abd718.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_abd718() { + var res: vec2 = ldexp(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_abd718(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_abd718(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_abd718(); +} diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl new file mode 100644 index 0000000000..af7d67b934 --- /dev/null +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_abd718() { + float2 res = ldexp(float2(0.0f, 0.0f), int2(0, 0)); +} + +void vertex_main() { + ldexp_abd718(); + return; +} + +void fragment_main() { + ldexp_abd718(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_abd718(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl new file mode 100644 index 0000000000..86338d3227 --- /dev/null +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ldexp_abd718() { + float2 res = ldexp(float2(), int2()); +} + +vertex void vertex_main() { + ldexp_abd718(); + return; +} + +fragment void fragment_main() { + ldexp_abd718(); + return; +} + +kernel void compute_main() { + ldexp_abd718(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm new file mode 100644 index 0000000000..5d84f62c8e --- /dev/null +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_abd718 "ldexp_abd718" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %15 = OpConstantNull %v2int +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%ldexp_abd718 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_abd718 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_abd718 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_abd718 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl new file mode 100644 index 0000000000..8d38ecd799 --- /dev/null +++ b/test/intrinsics/gen/ldexp/abd718.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_abd718() { + var res : vec2 = ldexp(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_abd718(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_abd718(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_abd718(); +} diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl new file mode 100644 index 0000000000..12d88ce0df --- /dev/null +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_cc9cde() { + var res: vec4 = ldexp(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_cc9cde(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_cc9cde(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_cc9cde(); +} diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl new file mode 100644 index 0000000000..8134010096 --- /dev/null +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_cc9cde() { + float4 res = ldexp(float4(0.0f, 0.0f, 0.0f, 0.0f), int4(0, 0, 0, 0)); +} + +void vertex_main() { + ldexp_cc9cde(); + return; +} + +void fragment_main() { + ldexp_cc9cde(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_cc9cde(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl new file mode 100644 index 0000000000..59232fddfc --- /dev/null +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ldexp_cc9cde() { + float4 res = ldexp(float4(), int4()); +} + +vertex void vertex_main() { + ldexp_cc9cde(); + return; +} + +fragment void fragment_main() { + ldexp_cc9cde(); + return; +} + +kernel void compute_main() { + ldexp_cc9cde(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm new file mode 100644 index 0000000000..085dc1a7c4 --- /dev/null +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.spvasm @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_cc9cde "ldexp_cc9cde" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %15 = OpConstantNull %v4int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%ldexp_cc9cde = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Ldexp %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %ldexp_cc9cde + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_cc9cde + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %ldexp_cc9cde + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl new file mode 100644 index 0000000000..5db48cec11 --- /dev/null +++ b/test/intrinsics/gen/ldexp/cc9cde.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_cc9cde() { + var res : vec4 = ldexp(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_cc9cde(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_cc9cde(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_cc9cde(); +} diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl new file mode 100644 index 0000000000..97f4987f5a --- /dev/null +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_db8b49() { + var res: f32 = ldexp(1.0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_db8b49(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_db8b49(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_db8b49(); +} diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl new file mode 100644 index 0000000000..db60414d1d --- /dev/null +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_db8b49() { + float res = ldexp(1.0f, 1); +} + +void vertex_main() { + ldexp_db8b49(); + return; +} + +void fragment_main() { + ldexp_db8b49(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_db8b49(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl new file mode 100644 index 0000000000..08368a36db --- /dev/null +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ldexp_db8b49() { + float res = ldexp(1.0f, 1); +} + +vertex void vertex_main() { + ldexp_db8b49(); + return; +} + +fragment void fragment_main() { + ldexp_db8b49(); + return; +} + +kernel void compute_main() { + ldexp_db8b49(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm new file mode 100644 index 0000000000..fd415e68bd --- /dev/null +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_db8b49 "ldexp_db8b49" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float +%ldexp_db8b49 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Ldexp %float_1 %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %ldexp_db8b49 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %ldexp_db8b49 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_db8b49 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl new file mode 100644 index 0000000000..cc84308884 --- /dev/null +++ b/test/intrinsics/gen/ldexp/db8b49.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_db8b49() { + var res : f32 = ldexp(1.0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_db8b49(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_db8b49(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_db8b49(); +} diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl new file mode 100644 index 0000000000..dfe420aad9 --- /dev/null +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn ldexp_f54ff2() { + var res: f32 = ldexp(1.0, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_f54ff2(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_f54ff2(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_f54ff2(); +} diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl new file mode 100644 index 0000000000..d674b8dc86 --- /dev/null +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void ldexp_f54ff2() { + float res = ldexp(1.0f, 1u); +} + +void vertex_main() { + ldexp_f54ff2(); + return; +} + +void fragment_main() { + ldexp_f54ff2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + ldexp_f54ff2(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl new file mode 100644 index 0000000000..4980cea0cb --- /dev/null +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void ldexp_f54ff2() { + float res = ldexp(1.0f, 1u); +} + +vertex void vertex_main() { + ldexp_f54ff2(); + return; +} + +fragment void fragment_main() { + ldexp_f54ff2(); + return; +} + +kernel void compute_main() { + ldexp_f54ff2(); + return; +} + diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm new file mode 100644 index 0000000000..6d449b0297 --- /dev/null +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %ldexp_f54ff2 "ldexp_f54ff2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_float = OpTypePointer Function %float +%ldexp_f54ff2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Ldexp %float_1 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %ldexp_f54ff2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %ldexp_f54ff2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %ldexp_f54ff2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl new file mode 100644 index 0000000000..aea15a05a3 --- /dev/null +++ b/test/intrinsics/gen/ldexp/f54ff2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn ldexp_f54ff2() { + var res : f32 = ldexp(1.0, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + ldexp_f54ff2(); +} + +[[stage(fragment)]] +fn fragment_main() { + ldexp_f54ff2(); +} + +[[stage(compute)]] +fn compute_main() { + ldexp_f54ff2(); +} diff --git a/test/intrinsics/gen/length/056071.wgsl b/test/intrinsics/gen/length/056071.wgsl new file mode 100644 index 0000000000..61c6111e4c --- /dev/null +++ b/test/intrinsics/gen/length/056071.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn length_056071() { + var res: f32 = length(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_056071(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_056071(); +} + +[[stage(compute)]] +fn compute_main() { + length_056071(); +} diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.hlsl b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl new file mode 100644 index 0000000000..a3ffa2ac31 --- /dev/null +++ b/test/intrinsics/gen/length/056071.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void length_056071() { + float res = length(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + length_056071(); + return; +} + +void fragment_main() { + length_056071(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + length_056071(); + return; +} + diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.msl b/test/intrinsics/gen/length/056071.wgsl.expected.msl new file mode 100644 index 0000000000..5ea9ae94b5 --- /dev/null +++ b/test/intrinsics/gen/length/056071.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void length_056071() { + float res = length(float3()); +} + +vertex void vertex_main() { + length_056071(); + return; +} + +fragment void fragment_main() { + length_056071(); + return; +} + +kernel void compute_main() { + length_056071(); + return; +} + diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.spvasm b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm new file mode 100644 index 0000000000..8fd89832e0 --- /dev/null +++ b/test/intrinsics/gen/length/056071.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %length_056071 "length_056071" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%length_056071 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Length %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %length_056071 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %length_056071 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %length_056071 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/length/056071.wgsl.expected.wgsl b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl new file mode 100644 index 0000000000..76b3aa824b --- /dev/null +++ b/test/intrinsics/gen/length/056071.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn length_056071() { + var res : f32 = length(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_056071(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_056071(); +} + +[[stage(compute)]] +fn compute_main() { + length_056071(); +} diff --git a/test/intrinsics/gen/length/602a17.wgsl b/test/intrinsics/gen/length/602a17.wgsl new file mode 100644 index 0000000000..6f5d3b5aa2 --- /dev/null +++ b/test/intrinsics/gen/length/602a17.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn length_602a17() { + var res: f32 = length(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + length_602a17(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_602a17(); +} + +[[stage(compute)]] +fn compute_main() { + length_602a17(); +} diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl new file mode 100644 index 0000000000..db461f8412 --- /dev/null +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void length_602a17() { + float res = length(1.0f); +} + +void vertex_main() { + length_602a17(); + return; +} + +void fragment_main() { + length_602a17(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + length_602a17(); + return; +} + diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.msl b/test/intrinsics/gen/length/602a17.wgsl.expected.msl new file mode 100644 index 0000000000..38e7b33241 --- /dev/null +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.msl @@ -0,0 +1,50 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void length_602a17() { + float res = length(1.0f); +} + +vertex void vertex_main() { + length_602a17(); + return; +} + +fragment void fragment_main() { + length_602a17(); + return; +} + +kernel void compute_main() { + length_602a17(); + return; +} + + +tint_bg8DxD.metal:5:17: error: call to 'length' is ambiguous + float res = length(1.0f); + ^~~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:295:17: note: candidate function +METAL_FUNC half length(half2 x) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:326:17: note: candidate function +METAL_FUNC half length(half3 x) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:357:17: note: candidate function +METAL_FUNC half length(half4 x) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:388:18: note: candidate function +METAL_FUNC float length(float2 x) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:431:18: note: candidate function +METAL_FUNC float length(float3 x) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:474:18: note: candidate function +METAL_FUNC float length(float4 x) + ^ +1 error generated. diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm new file mode 100644 index 0000000000..68516f0817 --- /dev/null +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %length_602a17 "length_602a17" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%length_602a17 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Length %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %length_602a17 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %length_602a17 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %length_602a17 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl new file mode 100644 index 0000000000..2b6b9e9745 --- /dev/null +++ b/test/intrinsics/gen/length/602a17.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn length_602a17() { + var res : f32 = length(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + length_602a17(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_602a17(); +} + +[[stage(compute)]] +fn compute_main() { + length_602a17(); +} diff --git a/test/intrinsics/gen/length/afde8b.wgsl b/test/intrinsics/gen/length/afde8b.wgsl new file mode 100644 index 0000000000..fde4834af0 --- /dev/null +++ b/test/intrinsics/gen/length/afde8b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn length_afde8b() { + var res: f32 = length(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_afde8b(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_afde8b(); +} + +[[stage(compute)]] +fn compute_main() { + length_afde8b(); +} diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl new file mode 100644 index 0000000000..005dc5a814 --- /dev/null +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void length_afde8b() { + float res = length(float2(0.0f, 0.0f)); +} + +void vertex_main() { + length_afde8b(); + return; +} + +void fragment_main() { + length_afde8b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + length_afde8b(); + return; +} + diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.msl b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl new file mode 100644 index 0000000000..56514b1c01 --- /dev/null +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void length_afde8b() { + float res = length(float2()); +} + +vertex void vertex_main() { + length_afde8b(); + return; +} + +fragment void fragment_main() { + length_afde8b(); + return; +} + +kernel void compute_main() { + length_afde8b(); + return; +} + diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm new file mode 100644 index 0000000000..70f5d76a05 --- /dev/null +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %length_afde8b "length_afde8b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%length_afde8b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Length %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %length_afde8b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %length_afde8b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %length_afde8b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl new file mode 100644 index 0000000000..052f0afd45 --- /dev/null +++ b/test/intrinsics/gen/length/afde8b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn length_afde8b() { + var res : f32 = length(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_afde8b(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_afde8b(); +} + +[[stage(compute)]] +fn compute_main() { + length_afde8b(); +} diff --git a/test/intrinsics/gen/length/becebf.wgsl b/test/intrinsics/gen/length/becebf.wgsl new file mode 100644 index 0000000000..447d82ee0f --- /dev/null +++ b/test/intrinsics/gen/length/becebf.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn length_becebf() { + var res: f32 = length(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_becebf(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_becebf(); +} + +[[stage(compute)]] +fn compute_main() { + length_becebf(); +} diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl new file mode 100644 index 0000000000..a1c4197fba --- /dev/null +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void length_becebf() { + float res = length(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + length_becebf(); + return; +} + +void fragment_main() { + length_becebf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + length_becebf(); + return; +} + diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.msl b/test/intrinsics/gen/length/becebf.wgsl.expected.msl new file mode 100644 index 0000000000..a63f31af01 --- /dev/null +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void length_becebf() { + float res = length(float4()); +} + +vertex void vertex_main() { + length_becebf(); + return; +} + +fragment void fragment_main() { + length_becebf(); + return; +} + +kernel void compute_main() { + length_becebf(); + return; +} + diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm new file mode 100644 index 0000000000..48be6d3443 --- /dev/null +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %length_becebf "length_becebf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%length_becebf = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Length %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %length_becebf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %length_becebf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %length_becebf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl new file mode 100644 index 0000000000..c8a2c423e5 --- /dev/null +++ b/test/intrinsics/gen/length/becebf.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn length_becebf() { + var res : f32 = length(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + length_becebf(); +} + +[[stage(fragment)]] +fn fragment_main() { + length_becebf(); +} + +[[stage(compute)]] +fn compute_main() { + length_becebf(); +} diff --git a/test/intrinsics/gen/log/3da25a.wgsl b/test/intrinsics/gen/log/3da25a.wgsl new file mode 100644 index 0000000000..07716b2087 --- /dev/null +++ b/test/intrinsics/gen/log/3da25a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log_3da25a() { + var res: vec4 = log(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_3da25a(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_3da25a(); +} + +[[stage(compute)]] +fn compute_main() { + log_3da25a(); +} diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl new file mode 100644 index 0000000000..7a247e39b4 --- /dev/null +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log_3da25a() { + float4 res = log(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + log_3da25a(); + return; +} + +void fragment_main() { + log_3da25a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log_3da25a(); + return; +} + diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.msl b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl new file mode 100644 index 0000000000..ff81127568 --- /dev/null +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log_3da25a() { + float4 res = log(float4()); +} + +vertex void vertex_main() { + log_3da25a(); + return; +} + +fragment void fragment_main() { + log_3da25a(); + return; +} + +kernel void compute_main() { + log_3da25a(); + return; +} + diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm new file mode 100644 index 0000000000..3d66145f48 --- /dev/null +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log_3da25a "log_3da25a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %log_3da25a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Log %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log_3da25a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log_3da25a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log_3da25a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl new file mode 100644 index 0000000000..452e71cfc0 --- /dev/null +++ b/test/intrinsics/gen/log/3da25a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log_3da25a() { + var res : vec4 = log(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_3da25a(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_3da25a(); +} + +[[stage(compute)]] +fn compute_main() { + log_3da25a(); +} diff --git a/test/intrinsics/gen/log/7114a6.wgsl b/test/intrinsics/gen/log/7114a6.wgsl new file mode 100644 index 0000000000..bac8f95462 --- /dev/null +++ b/test/intrinsics/gen/log/7114a6.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log_7114a6() { + var res: f32 = log(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + log_7114a6(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_7114a6(); +} + +[[stage(compute)]] +fn compute_main() { + log_7114a6(); +} diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl new file mode 100644 index 0000000000..e1f96d23d0 --- /dev/null +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log_7114a6() { + float res = log(1.0f); +} + +void vertex_main() { + log_7114a6(); + return; +} + +void fragment_main() { + log_7114a6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log_7114a6(); + return; +} + diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.msl b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl new file mode 100644 index 0000000000..e052391586 --- /dev/null +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log_7114a6() { + float res = log(1.0f); +} + +vertex void vertex_main() { + log_7114a6(); + return; +} + +fragment void fragment_main() { + log_7114a6(); + return; +} + +kernel void compute_main() { + log_7114a6(); + return; +} + diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm new file mode 100644 index 0000000000..fd0a41cf8d --- /dev/null +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log_7114a6 "log_7114a6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %log_7114a6 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Log %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %log_7114a6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %log_7114a6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %log_7114a6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl new file mode 100644 index 0000000000..9887a633bb --- /dev/null +++ b/test/intrinsics/gen/log/7114a6.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log_7114a6() { + var res : f32 = log(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + log_7114a6(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_7114a6(); +} + +[[stage(compute)]] +fn compute_main() { + log_7114a6(); +} diff --git a/test/intrinsics/gen/log/b2ce28.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl new file mode 100644 index 0000000000..540615d9c9 --- /dev/null +++ b/test/intrinsics/gen/log/b2ce28.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log_b2ce28() { + var res: vec2 = log(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_b2ce28(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_b2ce28(); +} + +[[stage(compute)]] +fn compute_main() { + log_b2ce28(); +} diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl new file mode 100644 index 0000000000..0e6d75d531 --- /dev/null +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log_b2ce28() { + float2 res = log(float2(0.0f, 0.0f)); +} + +void vertex_main() { + log_b2ce28(); + return; +} + +void fragment_main() { + log_b2ce28(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log_b2ce28(); + return; +} + diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl new file mode 100644 index 0000000000..69f048aae4 --- /dev/null +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log_b2ce28() { + float2 res = log(float2()); +} + +vertex void vertex_main() { + log_b2ce28(); + return; +} + +fragment void fragment_main() { + log_b2ce28(); + return; +} + +kernel void compute_main() { + log_b2ce28(); + return; +} + diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm new file mode 100644 index 0000000000..3615a64151 --- /dev/null +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log_b2ce28 "log_b2ce28" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %log_b2ce28 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Log %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log_b2ce28 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log_b2ce28 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log_b2ce28 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl new file mode 100644 index 0000000000..3e98760184 --- /dev/null +++ b/test/intrinsics/gen/log/b2ce28.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log_b2ce28() { + var res : vec2 = log(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_b2ce28(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_b2ce28(); +} + +[[stage(compute)]] +fn compute_main() { + log_b2ce28(); +} diff --git a/test/intrinsics/gen/log/f4c570.wgsl b/test/intrinsics/gen/log/f4c570.wgsl new file mode 100644 index 0000000000..70a5b35ff5 --- /dev/null +++ b/test/intrinsics/gen/log/f4c570.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log_f4c570() { + var res: vec3 = log(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_f4c570(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_f4c570(); +} + +[[stage(compute)]] +fn compute_main() { + log_f4c570(); +} diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl new file mode 100644 index 0000000000..92b5439d50 --- /dev/null +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log_f4c570() { + float3 res = log(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + log_f4c570(); + return; +} + +void fragment_main() { + log_f4c570(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log_f4c570(); + return; +} + diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.msl b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl new file mode 100644 index 0000000000..e1b3061479 --- /dev/null +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log_f4c570() { + float3 res = log(float3()); +} + +vertex void vertex_main() { + log_f4c570(); + return; +} + +fragment void fragment_main() { + log_f4c570(); + return; +} + +kernel void compute_main() { + log_f4c570(); + return; +} + diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm new file mode 100644 index 0000000000..367cee2770 --- /dev/null +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log_f4c570 "log_f4c570" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %log_f4c570 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Log %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log_f4c570 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log_f4c570 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log_f4c570 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl new file mode 100644 index 0000000000..57a2f172f6 --- /dev/null +++ b/test/intrinsics/gen/log/f4c570.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log_f4c570() { + var res : vec3 = log(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + log_f4c570(); +} + +[[stage(fragment)]] +fn fragment_main() { + log_f4c570(); +} + +[[stage(compute)]] +fn compute_main() { + log_f4c570(); +} diff --git a/test/intrinsics/gen/log2/4036ed.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl new file mode 100644 index 0000000000..12a5124114 --- /dev/null +++ b/test/intrinsics/gen/log2/4036ed.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log2_4036ed() { + var res: f32 = log2(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_4036ed(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_4036ed(); +} + +[[stage(compute)]] +fn compute_main() { + log2_4036ed(); +} diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl new file mode 100644 index 0000000000..64d6c003cc --- /dev/null +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log2_4036ed() { + float res = log2(1.0f); +} + +void vertex_main() { + log2_4036ed(); + return; +} + +void fragment_main() { + log2_4036ed(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log2_4036ed(); + return; +} + diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl new file mode 100644 index 0000000000..30658f2a21 --- /dev/null +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log2_4036ed() { + float res = log2(1.0f); +} + +vertex void vertex_main() { + log2_4036ed(); + return; +} + +fragment void fragment_main() { + log2_4036ed(); + return; +} + +kernel void compute_main() { + log2_4036ed(); + return; +} + diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm new file mode 100644 index 0000000000..25873c2a4c --- /dev/null +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log2_4036ed "log2_4036ed" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%log2_4036ed = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Log2 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %log2_4036ed + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %log2_4036ed + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %log2_4036ed + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl new file mode 100644 index 0000000000..c188875655 --- /dev/null +++ b/test/intrinsics/gen/log2/4036ed.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log2_4036ed() { + var res : f32 = log2(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_4036ed(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_4036ed(); +} + +[[stage(compute)]] +fn compute_main() { + log2_4036ed(); +} diff --git a/test/intrinsics/gen/log2/902988.wgsl b/test/intrinsics/gen/log2/902988.wgsl new file mode 100644 index 0000000000..37fa4358bb --- /dev/null +++ b/test/intrinsics/gen/log2/902988.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log2_902988() { + var res: vec4 = log2(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_902988(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_902988(); +} + +[[stage(compute)]] +fn compute_main() { + log2_902988(); +} diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl new file mode 100644 index 0000000000..cf1503fa3a --- /dev/null +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log2_902988() { + float4 res = log2(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + log2_902988(); + return; +} + +void fragment_main() { + log2_902988(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log2_902988(); + return; +} + diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.msl b/test/intrinsics/gen/log2/902988.wgsl.expected.msl new file mode 100644 index 0000000000..4a9bd89c53 --- /dev/null +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log2_902988() { + float4 res = log2(float4()); +} + +vertex void vertex_main() { + log2_902988(); + return; +} + +fragment void fragment_main() { + log2_902988(); + return; +} + +kernel void compute_main() { + log2_902988(); + return; +} + diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm new file mode 100644 index 0000000000..bab1daa121 --- /dev/null +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log2_902988 "log2_902988" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%log2_902988 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Log2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log2_902988 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log2_902988 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log2_902988 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl new file mode 100644 index 0000000000..9f4b264493 --- /dev/null +++ b/test/intrinsics/gen/log2/902988.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log2_902988() { + var res : vec4 = log2(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_902988(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_902988(); +} + +[[stage(compute)]] +fn compute_main() { + log2_902988(); +} diff --git a/test/intrinsics/gen/log2/adb233.wgsl b/test/intrinsics/gen/log2/adb233.wgsl new file mode 100644 index 0000000000..54b7dc356f --- /dev/null +++ b/test/intrinsics/gen/log2/adb233.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log2_adb233() { + var res: vec3 = log2(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_adb233(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_adb233(); +} + +[[stage(compute)]] +fn compute_main() { + log2_adb233(); +} diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl new file mode 100644 index 0000000000..d78b7131f7 --- /dev/null +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log2_adb233() { + float3 res = log2(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + log2_adb233(); + return; +} + +void fragment_main() { + log2_adb233(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log2_adb233(); + return; +} + diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.msl b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl new file mode 100644 index 0000000000..8e122aa371 --- /dev/null +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log2_adb233() { + float3 res = log2(float3()); +} + +vertex void vertex_main() { + log2_adb233(); + return; +} + +fragment void fragment_main() { + log2_adb233(); + return; +} + +kernel void compute_main() { + log2_adb233(); + return; +} + diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm new file mode 100644 index 0000000000..60d3c54eaf --- /dev/null +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log2_adb233 "log2_adb233" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%log2_adb233 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Log2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log2_adb233 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log2_adb233 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log2_adb233 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl new file mode 100644 index 0000000000..1b6e0ca52d --- /dev/null +++ b/test/intrinsics/gen/log2/adb233.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log2_adb233() { + var res : vec3 = log2(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_adb233(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_adb233(); +} + +[[stage(compute)]] +fn compute_main() { + log2_adb233(); +} diff --git a/test/intrinsics/gen/log2/aea659.wgsl b/test/intrinsics/gen/log2/aea659.wgsl new file mode 100644 index 0000000000..b9d25e4dad --- /dev/null +++ b/test/intrinsics/gen/log2/aea659.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn log2_aea659() { + var res: vec2 = log2(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_aea659(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_aea659(); +} + +[[stage(compute)]] +fn compute_main() { + log2_aea659(); +} diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl new file mode 100644 index 0000000000..d4bf6edf33 --- /dev/null +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void log2_aea659() { + float2 res = log2(float2(0.0f, 0.0f)); +} + +void vertex_main() { + log2_aea659(); + return; +} + +void fragment_main() { + log2_aea659(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + log2_aea659(); + return; +} + diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.msl b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl new file mode 100644 index 0000000000..fa4ade208c --- /dev/null +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void log2_aea659() { + float2 res = log2(float2()); +} + +vertex void vertex_main() { + log2_aea659(); + return; +} + +fragment void fragment_main() { + log2_aea659(); + return; +} + +kernel void compute_main() { + log2_aea659(); + return; +} + diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm new file mode 100644 index 0000000000..ac0c81598c --- /dev/null +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %log2_aea659 "log2_aea659" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%log2_aea659 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Log2 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %log2_aea659 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %log2_aea659 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %log2_aea659 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl new file mode 100644 index 0000000000..f21cead4d0 --- /dev/null +++ b/test/intrinsics/gen/log2/aea659.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn log2_aea659() { + var res : vec2 = log2(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + log2_aea659(); +} + +[[stage(fragment)]] +fn fragment_main() { + log2_aea659(); +} + +[[stage(compute)]] +fn compute_main() { + log2_aea659(); +} diff --git a/test/intrinsics/gen/max/0c0aae.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl new file mode 100644 index 0000000000..e68b5020cf --- /dev/null +++ b/test/intrinsics/gen/max/0c0aae.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_0c0aae() { + var res: u32 = max(1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + max_0c0aae(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_0c0aae(); +} + +[[stage(compute)]] +fn compute_main() { + max_0c0aae(); +} diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl new file mode 100644 index 0000000000..9190770d4c --- /dev/null +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_0c0aae() { + uint res = max(1u, 1u); +} + +void vertex_main() { + max_0c0aae(); + return; +} + +void fragment_main() { + max_0c0aae(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_0c0aae(); + return; +} + diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl new file mode 100644 index 0000000000..c70f54675d --- /dev/null +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_0c0aae() { + uint res = max(1u, 1u); +} + +vertex void vertex_main() { + max_0c0aae(); + return; +} + +fragment void fragment_main() { + max_0c0aae(); + return; +} + +kernel void compute_main() { + max_0c0aae(); + return; +} + diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm new file mode 100644 index 0000000000..16889df796 --- /dev/null +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_0c0aae "max_0c0aae" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpConstantNull %uint + %float_1 = OpConstant %float 1 + %max_0c0aae = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %15 + %9 = OpExtInst %uint %11 UMax %uint_1 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_0c0aae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_0c0aae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_0c0aae + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl new file mode 100644 index 0000000000..911ceb08f1 --- /dev/null +++ b/test/intrinsics/gen/max/0c0aae.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_0c0aae() { + var res : u32 = max(1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + max_0c0aae(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_0c0aae(); +} + +[[stage(compute)]] +fn compute_main() { + max_0c0aae(); +} diff --git a/test/intrinsics/gen/max/25eafe.wgsl b/test/intrinsics/gen/max/25eafe.wgsl new file mode 100644 index 0000000000..1662e9fb93 --- /dev/null +++ b/test/intrinsics/gen/max/25eafe.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_25eafe() { + var res: vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_25eafe(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_25eafe(); +} + +[[stage(compute)]] +fn compute_main() { + max_25eafe(); +} diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl new file mode 100644 index 0000000000..fbd6119215 --- /dev/null +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_25eafe() { + int3 res = max(int3(0, 0, 0), int3(0, 0, 0)); +} + +void vertex_main() { + max_25eafe(); + return; +} + +void fragment_main() { + max_25eafe(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_25eafe(); + return; +} + diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.msl b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl new file mode 100644 index 0000000000..42f0ea3e9d --- /dev/null +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_25eafe() { + int3 res = max(int3(), int3()); +} + +vertex void vertex_main() { + max_25eafe(); + return; +} + +fragment void fragment_main() { + max_25eafe(); + return; +} + +kernel void compute_main() { + max_25eafe(); + return; +} + diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm new file mode 100644 index 0000000000..2e5b431563 --- /dev/null +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_25eafe "max_25eafe" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %13 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 + %max_25eafe = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %13 + %9 = OpExtInst %v3int %12 SMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_25eafe + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_25eafe + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_25eafe + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl new file mode 100644 index 0000000000..7f7ed4657a --- /dev/null +++ b/test/intrinsics/gen/max/25eafe.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_25eafe() { + var res : vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_25eafe(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_25eafe(); +} + +[[stage(compute)]] +fn compute_main() { + max_25eafe(); +} diff --git a/test/intrinsics/gen/max/320815.wgsl b/test/intrinsics/gen/max/320815.wgsl new file mode 100644 index 0000000000..0e5a4268f8 --- /dev/null +++ b/test/intrinsics/gen/max/320815.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_320815() { + var res: vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_320815(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_320815(); +} + +[[stage(compute)]] +fn compute_main() { + max_320815(); +} diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.hlsl b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl new file mode 100644 index 0000000000..454bb3a4fd --- /dev/null +++ b/test/intrinsics/gen/max/320815.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_320815() { + uint2 res = max(uint2(0u, 0u), uint2(0u, 0u)); +} + +void vertex_main() { + max_320815(); + return; +} + +void fragment_main() { + max_320815(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_320815(); + return; +} + diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.msl b/test/intrinsics/gen/max/320815.wgsl.expected.msl new file mode 100644 index 0000000000..4f151c198e --- /dev/null +++ b/test/intrinsics/gen/max/320815.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_320815() { + uint2 res = max(uint2(), uint2()); +} + +vertex void vertex_main() { + max_320815(); + return; +} + +fragment void fragment_main() { + max_320815(); + return; +} + +kernel void compute_main() { + max_320815(); + return; +} + diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.spvasm b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm new file mode 100644 index 0000000000..aaac67ee5c --- /dev/null +++ b/test/intrinsics/gen/max/320815.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_320815 "max_320815" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %13 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 + %max_320815 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %13 + %9 = OpExtInst %v2uint %12 UMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_320815 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_320815 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_320815 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/320815.wgsl.expected.wgsl b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl new file mode 100644 index 0000000000..f99eb40a2f --- /dev/null +++ b/test/intrinsics/gen/max/320815.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_320815() { + var res : vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_320815(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_320815(); +} + +[[stage(compute)]] +fn compute_main() { + max_320815(); +} diff --git a/test/intrinsics/gen/max/44a39d.wgsl b/test/intrinsics/gen/max/44a39d.wgsl new file mode 100644 index 0000000000..1767a3d464 --- /dev/null +++ b/test/intrinsics/gen/max/44a39d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_44a39d() { + var res: f32 = max(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + max_44a39d(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_44a39d(); +} + +[[stage(compute)]] +fn compute_main() { + max_44a39d(); +} diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl new file mode 100644 index 0000000000..5b3fdc306e --- /dev/null +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_44a39d() { + float res = max(1.0f, 1.0f); +} + +void vertex_main() { + max_44a39d(); + return; +} + +void fragment_main() { + max_44a39d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_44a39d(); + return; +} + diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.msl b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl new file mode 100644 index 0000000000..4dc7f9cb6b --- /dev/null +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_44a39d() { + float res = fmax(1.0f, 1.0f); +} + +vertex void vertex_main() { + max_44a39d(); + return; +} + +fragment void fragment_main() { + max_44a39d(); + return; +} + +kernel void compute_main() { + max_44a39d(); + return; +} + diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm new file mode 100644 index 0000000000..19bb7a410f --- /dev/null +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_44a39d "max_44a39d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %max_44a39d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 NMax %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %max_44a39d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %max_44a39d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_44a39d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl new file mode 100644 index 0000000000..d520c0634a --- /dev/null +++ b/test/intrinsics/gen/max/44a39d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_44a39d() { + var res : f32 = max(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + max_44a39d(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_44a39d(); +} + +[[stage(compute)]] +fn compute_main() { + max_44a39d(); +} diff --git a/test/intrinsics/gen/max/453e04.wgsl b/test/intrinsics/gen/max/453e04.wgsl new file mode 100644 index 0000000000..1ed4d30f4d --- /dev/null +++ b/test/intrinsics/gen/max/453e04.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_453e04() { + var res: vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_453e04(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_453e04(); +} + +[[stage(compute)]] +fn compute_main() { + max_453e04(); +} diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl new file mode 100644 index 0000000000..1500fa2346 --- /dev/null +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_453e04() { + uint4 res = max(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + max_453e04(); + return; +} + +void fragment_main() { + max_453e04(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_453e04(); + return; +} + diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.msl b/test/intrinsics/gen/max/453e04.wgsl.expected.msl new file mode 100644 index 0000000000..9704013d72 --- /dev/null +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_453e04() { + uint4 res = max(uint4(), uint4()); +} + +vertex void vertex_main() { + max_453e04(); + return; +} + +fragment void fragment_main() { + max_453e04(); + return; +} + +kernel void compute_main() { + max_453e04(); + return; +} + diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm new file mode 100644 index 0000000000..c043630ab8 --- /dev/null +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_453e04 "max_453e04" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %13 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 + %max_453e04 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %13 + %9 = OpExtInst %v4uint %12 UMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_453e04 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_453e04 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_453e04 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl new file mode 100644 index 0000000000..37ad8eb4dc --- /dev/null +++ b/test/intrinsics/gen/max/453e04.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_453e04() { + var res : vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_453e04(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_453e04(); +} + +[[stage(compute)]] +fn compute_main() { + max_453e04(); +} diff --git a/test/intrinsics/gen/max/462050.wgsl b/test/intrinsics/gen/max/462050.wgsl new file mode 100644 index 0000000000..1e694e8f9c --- /dev/null +++ b/test/intrinsics/gen/max/462050.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_462050() { + var res: vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_462050(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_462050(); +} + +[[stage(compute)]] +fn compute_main() { + max_462050(); +} diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.hlsl b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl new file mode 100644 index 0000000000..cab3796c5a --- /dev/null +++ b/test/intrinsics/gen/max/462050.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_462050() { + float2 res = max(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + max_462050(); + return; +} + +void fragment_main() { + max_462050(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_462050(); + return; +} + diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.msl b/test/intrinsics/gen/max/462050.wgsl.expected.msl new file mode 100644 index 0000000000..073d8dfbdc --- /dev/null +++ b/test/intrinsics/gen/max/462050.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_462050() { + float2 res = fmax(float2(), float2()); +} + +vertex void vertex_main() { + max_462050(); + return; +} + +fragment void fragment_main() { + max_462050(); + return; +} + +kernel void compute_main() { + max_462050(); + return; +} + diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.spvasm b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm new file mode 100644 index 0000000000..02f677907e --- /dev/null +++ b/test/intrinsics/gen/max/462050.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_462050 "max_462050" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %max_462050 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 NMax %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %max_462050 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %max_462050 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %max_462050 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/462050.wgsl.expected.wgsl b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl new file mode 100644 index 0000000000..07aa216a64 --- /dev/null +++ b/test/intrinsics/gen/max/462050.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_462050() { + var res : vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_462050(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_462050(); +} + +[[stage(compute)]] +fn compute_main() { + max_462050(); +} diff --git a/test/intrinsics/gen/max/4883ac.wgsl b/test/intrinsics/gen/max/4883ac.wgsl new file mode 100644 index 0000000000..e8da7d262b --- /dev/null +++ b/test/intrinsics/gen/max/4883ac.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_4883ac() { + var res: vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_4883ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_4883ac(); +} + +[[stage(compute)]] +fn compute_main() { + max_4883ac(); +} diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl new file mode 100644 index 0000000000..d14a43deb6 --- /dev/null +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_4883ac() { + float3 res = max(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + max_4883ac(); + return; +} + +void fragment_main() { + max_4883ac(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_4883ac(); + return; +} + diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.msl b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl new file mode 100644 index 0000000000..05f76163f6 --- /dev/null +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_4883ac() { + float3 res = fmax(float3(), float3()); +} + +vertex void vertex_main() { + max_4883ac(); + return; +} + +fragment void fragment_main() { + max_4883ac(); + return; +} + +kernel void compute_main() { + max_4883ac(); + return; +} + diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm new file mode 100644 index 0000000000..9af39250f9 --- /dev/null +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_4883ac "max_4883ac" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %max_4883ac = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 NMax %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %max_4883ac + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %max_4883ac + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %max_4883ac + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl new file mode 100644 index 0000000000..a066ad5998 --- /dev/null +++ b/test/intrinsics/gen/max/4883ac.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_4883ac() { + var res : vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_4883ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_4883ac(); +} + +[[stage(compute)]] +fn compute_main() { + max_4883ac(); +} diff --git a/test/intrinsics/gen/max/85e6bc.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl new file mode 100644 index 0000000000..a915f0d730 --- /dev/null +++ b/test/intrinsics/gen/max/85e6bc.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_85e6bc() { + var res: vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_85e6bc(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_85e6bc(); +} + +[[stage(compute)]] +fn compute_main() { + max_85e6bc(); +} diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl new file mode 100644 index 0000000000..17f9ed7922 --- /dev/null +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_85e6bc() { + int4 res = max(int4(0, 0, 0, 0), int4(0, 0, 0, 0)); +} + +void vertex_main() { + max_85e6bc(); + return; +} + +void fragment_main() { + max_85e6bc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_85e6bc(); + return; +} + diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl new file mode 100644 index 0000000000..67c75e73cd --- /dev/null +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_85e6bc() { + int4 res = max(int4(), int4()); +} + +vertex void vertex_main() { + max_85e6bc(); + return; +} + +fragment void fragment_main() { + max_85e6bc(); + return; +} + +kernel void compute_main() { + max_85e6bc(); + return; +} + diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm new file mode 100644 index 0000000000..b3dd4cab45 --- /dev/null +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_85e6bc "max_85e6bc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %13 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 + %max_85e6bc = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %13 + %9 = OpExtInst %v4int %12 SMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_85e6bc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_85e6bc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_85e6bc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl new file mode 100644 index 0000000000..2055bb62e0 --- /dev/null +++ b/test/intrinsics/gen/max/85e6bc.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_85e6bc() { + var res : vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_85e6bc(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_85e6bc(); +} + +[[stage(compute)]] +fn compute_main() { + max_85e6bc(); +} diff --git a/test/intrinsics/gen/max/a93419.wgsl b/test/intrinsics/gen/max/a93419.wgsl new file mode 100644 index 0000000000..18563379e0 --- /dev/null +++ b/test/intrinsics/gen/max/a93419.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_a93419() { + var res: vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_a93419(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_a93419(); +} + +[[stage(compute)]] +fn compute_main() { + max_a93419(); +} diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl new file mode 100644 index 0000000000..3701fa242d --- /dev/null +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_a93419() { + float4 res = max(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + max_a93419(); + return; +} + +void fragment_main() { + max_a93419(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_a93419(); + return; +} + diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.msl b/test/intrinsics/gen/max/a93419.wgsl.expected.msl new file mode 100644 index 0000000000..abe3fc60ac --- /dev/null +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_a93419() { + float4 res = fmax(float4(), float4()); +} + +vertex void vertex_main() { + max_a93419(); + return; +} + +fragment void fragment_main() { + max_a93419(); + return; +} + +kernel void compute_main() { + max_a93419(); + return; +} + diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm new file mode 100644 index 0000000000..c65a59f7a6 --- /dev/null +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_a93419 "max_a93419" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %max_a93419 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 NMax %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %max_a93419 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %max_a93419 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %max_a93419 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl new file mode 100644 index 0000000000..a278e21459 --- /dev/null +++ b/test/intrinsics/gen/max/a93419.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_a93419() { + var res : vec4 = max(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_a93419(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_a93419(); +} + +[[stage(compute)]] +fn compute_main() { + max_a93419(); +} diff --git a/test/intrinsics/gen/max/b1b73a.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl new file mode 100644 index 0000000000..2cbe7db15c --- /dev/null +++ b/test/intrinsics/gen/max/b1b73a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_b1b73a() { + var res: vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_b1b73a(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_b1b73a(); +} + +[[stage(compute)]] +fn compute_main() { + max_b1b73a(); +} diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl new file mode 100644 index 0000000000..7dca442bc2 --- /dev/null +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_b1b73a() { + uint3 res = max(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); +} + +void vertex_main() { + max_b1b73a(); + return; +} + +void fragment_main() { + max_b1b73a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_b1b73a(); + return; +} + diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl new file mode 100644 index 0000000000..979f9d5b37 --- /dev/null +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_b1b73a() { + uint3 res = max(uint3(), uint3()); +} + +vertex void vertex_main() { + max_b1b73a(); + return; +} + +fragment void fragment_main() { + max_b1b73a(); + return; +} + +kernel void compute_main() { + max_b1b73a(); + return; +} + diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm new file mode 100644 index 0000000000..4296bae461 --- /dev/null +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_b1b73a "max_b1b73a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %13 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 + %max_b1b73a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %13 + %9 = OpExtInst %v3uint %12 UMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_b1b73a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_b1b73a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_b1b73a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl new file mode 100644 index 0000000000..ff4689f737 --- /dev/null +++ b/test/intrinsics/gen/max/b1b73a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_b1b73a() { + var res : vec3 = max(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_b1b73a(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_b1b73a(); +} + +[[stage(compute)]] +fn compute_main() { + max_b1b73a(); +} diff --git a/test/intrinsics/gen/max/ce7c30.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl new file mode 100644 index 0000000000..6f44a08482 --- /dev/null +++ b/test/intrinsics/gen/max/ce7c30.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_ce7c30() { + var res: i32 = max(1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + max_ce7c30(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_ce7c30(); +} + +[[stage(compute)]] +fn compute_main() { + max_ce7c30(); +} diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl new file mode 100644 index 0000000000..581614a611 --- /dev/null +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_ce7c30() { + int res = max(1, 1); +} + +void vertex_main() { + max_ce7c30(); + return; +} + +void fragment_main() { + max_ce7c30(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_ce7c30(); + return; +} + diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl new file mode 100644 index 0000000000..125162cadd --- /dev/null +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_ce7c30() { + int res = max(1, 1); +} + +vertex void vertex_main() { + max_ce7c30(); + return; +} + +fragment void fragment_main() { + max_ce7c30(); + return; +} + +kernel void compute_main() { + max_ce7c30(); + return; +} + diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm new file mode 100644 index 0000000000..83b18b420c --- /dev/null +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_ce7c30 "max_ce7c30" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %15 = OpConstantNull %int + %float_1 = OpConstant %float 1 + %max_ce7c30 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %15 + %9 = OpExtInst %int %11 SMax %int_1 %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_ce7c30 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_ce7c30 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_ce7c30 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl new file mode 100644 index 0000000000..c682b34177 --- /dev/null +++ b/test/intrinsics/gen/max/ce7c30.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_ce7c30() { + var res : i32 = max(1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + max_ce7c30(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_ce7c30(); +} + +[[stage(compute)]] +fn compute_main() { + max_ce7c30(); +} diff --git a/test/intrinsics/gen/max/e8192f.wgsl b/test/intrinsics/gen/max/e8192f.wgsl new file mode 100644 index 0000000000..2609dcb199 --- /dev/null +++ b/test/intrinsics/gen/max/e8192f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn max_e8192f() { + var res: vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_e8192f(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_e8192f(); +} + +[[stage(compute)]] +fn compute_main() { + max_e8192f(); +} diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl new file mode 100644 index 0000000000..cda8e83577 --- /dev/null +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void max_e8192f() { + int2 res = max(int2(0, 0), int2(0, 0)); +} + +void vertex_main() { + max_e8192f(); + return; +} + +void fragment_main() { + max_e8192f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + max_e8192f(); + return; +} + diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.msl b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl new file mode 100644 index 0000000000..c6165c3861 --- /dev/null +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void max_e8192f() { + int2 res = max(int2(), int2()); +} + +vertex void vertex_main() { + max_e8192f(); + return; +} + +fragment void fragment_main() { + max_e8192f(); + return; +} + +kernel void compute_main() { + max_e8192f(); + return; +} + diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm new file mode 100644 index 0000000000..676cac1b8a --- /dev/null +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %max_e8192f "max_e8192f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %13 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 + %max_e8192f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %13 + %9 = OpExtInst %v2int %12 SMax %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %max_e8192f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %max_e8192f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %max_e8192f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl new file mode 100644 index 0000000000..b5720fbd35 --- /dev/null +++ b/test/intrinsics/gen/max/e8192f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn max_e8192f() { + var res : vec2 = max(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + max_e8192f(); +} + +[[stage(fragment)]] +fn fragment_main() { + max_e8192f(); +} + +[[stage(compute)]] +fn compute_main() { + max_e8192f(); +} diff --git a/test/intrinsics/gen/min/03c7e3.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl new file mode 100644 index 0000000000..9b0727fa1b --- /dev/null +++ b/test/intrinsics/gen/min/03c7e3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_03c7e3() { + var res: vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_03c7e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_03c7e3(); +} + +[[stage(compute)]] +fn compute_main() { + min_03c7e3(); +} diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl new file mode 100644 index 0000000000..c4e4bbb7a5 --- /dev/null +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_03c7e3() { + int2 res = min(int2(0, 0), int2(0, 0)); +} + +void vertex_main() { + min_03c7e3(); + return; +} + +void fragment_main() { + min_03c7e3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_03c7e3(); + return; +} + diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl new file mode 100644 index 0000000000..ba682096c7 --- /dev/null +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_03c7e3() { + int2 res = min(int2(), int2()); +} + +vertex void vertex_main() { + min_03c7e3(); + return; +} + +fragment void fragment_main() { + min_03c7e3(); + return; +} + +kernel void compute_main() { + min_03c7e3(); + return; +} + diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm new file mode 100644 index 0000000000..a2d7d52a04 --- /dev/null +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_03c7e3 "min_03c7e3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %13 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 + %min_03c7e3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %13 + %9 = OpExtInst %v2int %12 SMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_03c7e3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_03c7e3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_03c7e3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl new file mode 100644 index 0000000000..2098c208d8 --- /dev/null +++ b/test/intrinsics/gen/min/03c7e3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_03c7e3() { + var res : vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_03c7e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_03c7e3(); +} + +[[stage(compute)]] +fn compute_main() { + min_03c7e3(); +} diff --git a/test/intrinsics/gen/min/0dc614.wgsl b/test/intrinsics/gen/min/0dc614.wgsl new file mode 100644 index 0000000000..7f33995076 --- /dev/null +++ b/test/intrinsics/gen/min/0dc614.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_0dc614() { + var res: vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_0dc614(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_0dc614(); +} + +[[stage(compute)]] +fn compute_main() { + min_0dc614(); +} diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl new file mode 100644 index 0000000000..2916bb5c13 --- /dev/null +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_0dc614() { + uint4 res = min(uint4(0u, 0u, 0u, 0u), uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + min_0dc614(); + return; +} + +void fragment_main() { + min_0dc614(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_0dc614(); + return; +} + diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.msl b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl new file mode 100644 index 0000000000..0baef43d19 --- /dev/null +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_0dc614() { + uint4 res = min(uint4(), uint4()); +} + +vertex void vertex_main() { + min_0dc614(); + return; +} + +fragment void fragment_main() { + min_0dc614(); + return; +} + +kernel void compute_main() { + min_0dc614(); + return; +} + diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm new file mode 100644 index 0000000000..52ba04ed03 --- /dev/null +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_0dc614 "min_0dc614" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %13 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 + %min_0dc614 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %13 + %9 = OpExtInst %v4uint %12 UMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_0dc614 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_0dc614 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_0dc614 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl new file mode 100644 index 0000000000..5c1965ca86 --- /dev/null +++ b/test/intrinsics/gen/min/0dc614.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_0dc614() { + var res : vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_0dc614(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_0dc614(); +} + +[[stage(compute)]] +fn compute_main() { + min_0dc614(); +} diff --git a/test/intrinsics/gen/min/3941e1.wgsl b/test/intrinsics/gen/min/3941e1.wgsl new file mode 100644 index 0000000000..4e741048fc --- /dev/null +++ b/test/intrinsics/gen/min/3941e1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_3941e1() { + var res: vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_3941e1(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_3941e1(); +} + +[[stage(compute)]] +fn compute_main() { + min_3941e1(); +} diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl new file mode 100644 index 0000000000..f21aacfae3 --- /dev/null +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_3941e1() { + int4 res = min(int4(0, 0, 0, 0), int4(0, 0, 0, 0)); +} + +void vertex_main() { + min_3941e1(); + return; +} + +void fragment_main() { + min_3941e1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_3941e1(); + return; +} + diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.msl b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl new file mode 100644 index 0000000000..25c94c3fc2 --- /dev/null +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_3941e1() { + int4 res = min(int4(), int4()); +} + +vertex void vertex_main() { + min_3941e1(); + return; +} + +fragment void fragment_main() { + min_3941e1(); + return; +} + +kernel void compute_main() { + min_3941e1(); + return; +} + diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm new file mode 100644 index 0000000000..1b3f0f3ce1 --- /dev/null +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_3941e1 "min_3941e1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %13 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 + %min_3941e1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %13 + %9 = OpExtInst %v4int %12 SMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_3941e1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_3941e1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_3941e1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl new file mode 100644 index 0000000000..cd5ed890fc --- /dev/null +++ b/test/intrinsics/gen/min/3941e1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_3941e1() { + var res : vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_3941e1(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_3941e1(); +} + +[[stage(compute)]] +fn compute_main() { + min_3941e1(); +} diff --git a/test/intrinsics/gen/min/46c5d3.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl new file mode 100644 index 0000000000..b1603fb113 --- /dev/null +++ b/test/intrinsics/gen/min/46c5d3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_46c5d3() { + var res: u32 = min(1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + min_46c5d3(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_46c5d3(); +} + +[[stage(compute)]] +fn compute_main() { + min_46c5d3(); +} diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl new file mode 100644 index 0000000000..fda2c28d37 --- /dev/null +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_46c5d3() { + uint res = min(1u, 1u); +} + +void vertex_main() { + min_46c5d3(); + return; +} + +void fragment_main() { + min_46c5d3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_46c5d3(); + return; +} + diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl new file mode 100644 index 0000000000..9d2021e016 --- /dev/null +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_46c5d3() { + uint res = min(1u, 1u); +} + +vertex void vertex_main() { + min_46c5d3(); + return; +} + +fragment void fragment_main() { + min_46c5d3(); + return; +} + +kernel void compute_main() { + min_46c5d3(); + return; +} + diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm new file mode 100644 index 0000000000..093c7c8e76 --- /dev/null +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_46c5d3 "min_46c5d3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %15 = OpConstantNull %uint + %float_1 = OpConstant %float 1 + %min_46c5d3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %15 + %9 = OpExtInst %uint %11 UMin %uint_1 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_46c5d3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_46c5d3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_46c5d3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl new file mode 100644 index 0000000000..4792db1420 --- /dev/null +++ b/test/intrinsics/gen/min/46c5d3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_46c5d3() { + var res : u32 = min(1u, 1u); +} + +[[stage(vertex)]] +fn vertex_main() { + min_46c5d3(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_46c5d3(); +} + +[[stage(compute)]] +fn compute_main() { + min_46c5d3(); +} diff --git a/test/intrinsics/gen/min/82b28f.wgsl b/test/intrinsics/gen/min/82b28f.wgsl new file mode 100644 index 0000000000..3dc216d130 --- /dev/null +++ b/test/intrinsics/gen/min/82b28f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_82b28f() { + var res: vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_82b28f(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_82b28f(); +} + +[[stage(compute)]] +fn compute_main() { + min_82b28f(); +} diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl new file mode 100644 index 0000000000..96cdb7268a --- /dev/null +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_82b28f() { + uint2 res = min(uint2(0u, 0u), uint2(0u, 0u)); +} + +void vertex_main() { + min_82b28f(); + return; +} + +void fragment_main() { + min_82b28f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_82b28f(); + return; +} + diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.msl b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl new file mode 100644 index 0000000000..c79d46648a --- /dev/null +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_82b28f() { + uint2 res = min(uint2(), uint2()); +} + +vertex void vertex_main() { + min_82b28f(); + return; +} + +fragment void fragment_main() { + min_82b28f(); + return; +} + +kernel void compute_main() { + min_82b28f(); + return; +} + diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm new file mode 100644 index 0000000000..869b476973 --- /dev/null +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_82b28f "min_82b28f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %13 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 + %min_82b28f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %13 + %9 = OpExtInst %v2uint %12 UMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_82b28f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_82b28f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_82b28f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl new file mode 100644 index 0000000000..cd3d2a7016 --- /dev/null +++ b/test/intrinsics/gen/min/82b28f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_82b28f() { + var res : vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_82b28f(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_82b28f(); +} + +[[stage(compute)]] +fn compute_main() { + min_82b28f(); +} diff --git a/test/intrinsics/gen/min/93cfc4.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl new file mode 100644 index 0000000000..af0896c2ab --- /dev/null +++ b/test/intrinsics/gen/min/93cfc4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_93cfc4() { + var res: vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_93cfc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_93cfc4(); +} + +[[stage(compute)]] +fn compute_main() { + min_93cfc4(); +} diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl new file mode 100644 index 0000000000..c3d2e41034 --- /dev/null +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_93cfc4() { + float3 res = min(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + min_93cfc4(); + return; +} + +void fragment_main() { + min_93cfc4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_93cfc4(); + return; +} + diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl new file mode 100644 index 0000000000..2333a21757 --- /dev/null +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_93cfc4() { + float3 res = fmin(float3(), float3()); +} + +vertex void vertex_main() { + min_93cfc4(); + return; +} + +fragment void fragment_main() { + min_93cfc4(); + return; +} + +kernel void compute_main() { + min_93cfc4(); + return; +} + diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm new file mode 100644 index 0000000000..c4c3db9322 --- /dev/null +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_93cfc4 "min_93cfc4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %min_93cfc4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 NMin %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %min_93cfc4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %min_93cfc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %min_93cfc4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl new file mode 100644 index 0000000000..a285e0decb --- /dev/null +++ b/test/intrinsics/gen/min/93cfc4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_93cfc4() { + var res : vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_93cfc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_93cfc4(); +} + +[[stage(compute)]] +fn compute_main() { + min_93cfc4(); +} diff --git a/test/intrinsics/gen/min/a45171.wgsl b/test/intrinsics/gen/min/a45171.wgsl new file mode 100644 index 0000000000..5c70dbad5d --- /dev/null +++ b/test/intrinsics/gen/min/a45171.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_a45171() { + var res: vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_a45171(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_a45171(); +} + +[[stage(compute)]] +fn compute_main() { + min_a45171(); +} diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl new file mode 100644 index 0000000000..7c4503eef5 --- /dev/null +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_a45171() { + int3 res = min(int3(0, 0, 0), int3(0, 0, 0)); +} + +void vertex_main() { + min_a45171(); + return; +} + +void fragment_main() { + min_a45171(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_a45171(); + return; +} + diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.msl b/test/intrinsics/gen/min/a45171.wgsl.expected.msl new file mode 100644 index 0000000000..9b4cdd6c5e --- /dev/null +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_a45171() { + int3 res = min(int3(), int3()); +} + +vertex void vertex_main() { + min_a45171(); + return; +} + +fragment void fragment_main() { + min_a45171(); + return; +} + +kernel void compute_main() { + min_a45171(); + return; +} + diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm new file mode 100644 index 0000000000..9b0d61174f --- /dev/null +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_a45171 "min_a45171" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %13 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 + %min_a45171 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %13 + %9 = OpExtInst %v3int %12 SMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_a45171 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_a45171 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_a45171 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl new file mode 100644 index 0000000000..4d10949536 --- /dev/null +++ b/test/intrinsics/gen/min/a45171.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_a45171() { + var res : vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_a45171(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_a45171(); +} + +[[stage(compute)]] +fn compute_main() { + min_a45171(); +} diff --git a/test/intrinsics/gen/min/aa28ad.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl new file mode 100644 index 0000000000..78ab7866de --- /dev/null +++ b/test/intrinsics/gen/min/aa28ad.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_aa28ad() { + var res: vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_aa28ad(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_aa28ad(); +} + +[[stage(compute)]] +fn compute_main() { + min_aa28ad(); +} diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl new file mode 100644 index 0000000000..adffe08059 --- /dev/null +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_aa28ad() { + float2 res = min(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + min_aa28ad(); + return; +} + +void fragment_main() { + min_aa28ad(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_aa28ad(); + return; +} + diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl new file mode 100644 index 0000000000..e3235d3cee --- /dev/null +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_aa28ad() { + float2 res = fmin(float2(), float2()); +} + +vertex void vertex_main() { + min_aa28ad(); + return; +} + +fragment void fragment_main() { + min_aa28ad(); + return; +} + +kernel void compute_main() { + min_aa28ad(); + return; +} + diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm new file mode 100644 index 0000000000..e37dabc85b --- /dev/null +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_aa28ad "min_aa28ad" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %min_aa28ad = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 NMin %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %min_aa28ad + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %min_aa28ad + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %min_aa28ad + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl new file mode 100644 index 0000000000..ea0d321b3a --- /dev/null +++ b/test/intrinsics/gen/min/aa28ad.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_aa28ad() { + var res : vec2 = min(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_aa28ad(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_aa28ad(); +} + +[[stage(compute)]] +fn compute_main() { + min_aa28ad(); +} diff --git a/test/intrinsics/gen/min/af326d.wgsl b/test/intrinsics/gen/min/af326d.wgsl new file mode 100644 index 0000000000..421360a452 --- /dev/null +++ b/test/intrinsics/gen/min/af326d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_af326d() { + var res: f32 = min(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + min_af326d(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_af326d(); +} + +[[stage(compute)]] +fn compute_main() { + min_af326d(); +} diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl new file mode 100644 index 0000000000..fd8e65a646 --- /dev/null +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_af326d() { + float res = min(1.0f, 1.0f); +} + +void vertex_main() { + min_af326d(); + return; +} + +void fragment_main() { + min_af326d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_af326d(); + return; +} + diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.msl b/test/intrinsics/gen/min/af326d.wgsl.expected.msl new file mode 100644 index 0000000000..9e219a38b9 --- /dev/null +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_af326d() { + float res = fmin(1.0f, 1.0f); +} + +vertex void vertex_main() { + min_af326d(); + return; +} + +fragment void fragment_main() { + min_af326d(); + return; +} + +kernel void compute_main() { + min_af326d(); + return; +} + diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm new file mode 100644 index 0000000000..a7c01c318e --- /dev/null +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_af326d "min_af326d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %min_af326d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 NMin %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %min_af326d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %min_af326d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_af326d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl new file mode 100644 index 0000000000..6e1515de20 --- /dev/null +++ b/test/intrinsics/gen/min/af326d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_af326d() { + var res : f32 = min(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + min_af326d(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_af326d(); +} + +[[stage(compute)]] +fn compute_main() { + min_af326d(); +} diff --git a/test/intrinsics/gen/min/c70bb7.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl new file mode 100644 index 0000000000..6daef6c409 --- /dev/null +++ b/test/intrinsics/gen/min/c70bb7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_c70bb7() { + var res: vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c70bb7(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c70bb7(); +} + +[[stage(compute)]] +fn compute_main() { + min_c70bb7(); +} diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl new file mode 100644 index 0000000000..0d4d6a6a55 --- /dev/null +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_c70bb7() { + uint3 res = min(uint3(0u, 0u, 0u), uint3(0u, 0u, 0u)); +} + +void vertex_main() { + min_c70bb7(); + return; +} + +void fragment_main() { + min_c70bb7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_c70bb7(); + return; +} + diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl new file mode 100644 index 0000000000..d49a6bcea3 --- /dev/null +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_c70bb7() { + uint3 res = min(uint3(), uint3()); +} + +vertex void vertex_main() { + min_c70bb7(); + return; +} + +fragment void fragment_main() { + min_c70bb7(); + return; +} + +kernel void compute_main() { + min_c70bb7(); + return; +} + diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm new file mode 100644 index 0000000000..c5b03abc9e --- /dev/null +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_c70bb7 "min_c70bb7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %13 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 + %min_c70bb7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %13 + %9 = OpExtInst %v3uint %12 UMin %13 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_c70bb7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_c70bb7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_c70bb7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl new file mode 100644 index 0000000000..3d86d952f2 --- /dev/null +++ b/test/intrinsics/gen/min/c70bb7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_c70bb7() { + var res : vec3 = min(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c70bb7(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c70bb7(); +} + +[[stage(compute)]] +fn compute_main() { + min_c70bb7(); +} diff --git a/test/intrinsics/gen/min/c73147.wgsl b/test/intrinsics/gen/min/c73147.wgsl new file mode 100644 index 0000000000..09dd3c44ea --- /dev/null +++ b/test/intrinsics/gen/min/c73147.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_c73147() { + var res: i32 = min(1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c73147(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c73147(); +} + +[[stage(compute)]] +fn compute_main() { + min_c73147(); +} diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl new file mode 100644 index 0000000000..3f6819a655 --- /dev/null +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_c73147() { + int res = min(1, 1); +} + +void vertex_main() { + min_c73147(); + return; +} + +void fragment_main() { + min_c73147(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_c73147(); + return; +} + diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.msl b/test/intrinsics/gen/min/c73147.wgsl.expected.msl new file mode 100644 index 0000000000..9ee44eea4c --- /dev/null +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_c73147() { + int res = min(1, 1); +} + +vertex void vertex_main() { + min_c73147(); + return; +} + +fragment void fragment_main() { + min_c73147(); + return; +} + +kernel void compute_main() { + min_c73147(); + return; +} + diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm new file mode 100644 index 0000000000..687c902425 --- /dev/null +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.spvasm @@ -0,0 +1,54 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_c73147 "min_c73147" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %15 = OpConstantNull %int + %float_1 = OpConstant %float 1 + %min_c73147 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %15 + %9 = OpExtInst %int %11 SMin %int_1 %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %19 = OpFunctionCall %void %min_c73147 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %min_c73147 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %24 = OpLabel + %25 = OpFunctionCall %void %min_c73147 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl new file mode 100644 index 0000000000..59a2cfc958 --- /dev/null +++ b/test/intrinsics/gen/min/c73147.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_c73147() { + var res : i32 = min(1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c73147(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c73147(); +} + +[[stage(compute)]] +fn compute_main() { + min_c73147(); +} diff --git a/test/intrinsics/gen/min/c76fa6.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl new file mode 100644 index 0000000000..86b14be5a7 --- /dev/null +++ b/test/intrinsics/gen/min/c76fa6.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn min_c76fa6() { + var res: vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c76fa6(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c76fa6(); +} + +[[stage(compute)]] +fn compute_main() { + min_c76fa6(); +} diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl new file mode 100644 index 0000000000..55d25a7062 --- /dev/null +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void min_c76fa6() { + float4 res = min(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + min_c76fa6(); + return; +} + +void fragment_main() { + min_c76fa6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + min_c76fa6(); + return; +} + diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl new file mode 100644 index 0000000000..85a723e770 --- /dev/null +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void min_c76fa6() { + float4 res = fmin(float4(), float4()); +} + +vertex void vertex_main() { + min_c76fa6(); + return; +} + +fragment void fragment_main() { + min_c76fa6(); + return; +} + +kernel void compute_main() { + min_c76fa6(); + return; +} + diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm new file mode 100644 index 0000000000..f8e63d7119 --- /dev/null +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %min_c76fa6 "min_c76fa6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %min_c76fa6 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 NMin %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %min_c76fa6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %min_c76fa6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %min_c76fa6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl new file mode 100644 index 0000000000..b9c81fd9f0 --- /dev/null +++ b/test/intrinsics/gen/min/c76fa6.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn min_c76fa6() { + var res : vec4 = min(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + min_c76fa6(); +} + +[[stage(fragment)]] +fn fragment_main() { + min_c76fa6(); +} + +[[stage(compute)]] +fn compute_main() { + min_c76fa6(); +} diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl new file mode 100644 index 0000000000..497f81a164 --- /dev/null +++ b/test/intrinsics/gen/mix/0c8c33.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn mix_0c8c33() { + var res: vec3 = mix(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_0c8c33(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_0c8c33(); +} + +[[stage(compute)]] +fn compute_main() { + mix_0c8c33(); +} diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl new file mode 100644 index 0000000000..b5206557a6 --- /dev/null +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void mix_0c8c33() { + float3 res = lerp(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + mix_0c8c33(); + return; +} + +void fragment_main() { + mix_0c8c33(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + mix_0c8c33(); + return; +} + diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl new file mode 100644 index 0000000000..a9ba57ea91 --- /dev/null +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void mix_0c8c33() { + float3 res = mix(float3(), float3(), float3()); +} + +vertex void vertex_main() { + mix_0c8c33(); + return; +} + +fragment void fragment_main() { + mix_0c8c33(); + return; +} + +kernel void compute_main() { + mix_0c8c33(); + return; +} + diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm new file mode 100644 index 0000000000..7ebdd25311 --- /dev/null +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %mix_0c8c33 "mix_0c8c33" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %mix_0c8c33 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 FMix %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %mix_0c8c33 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %mix_0c8c33 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %mix_0c8c33 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl new file mode 100644 index 0000000000..cbcde05263 --- /dev/null +++ b/test/intrinsics/gen/mix/0c8c33.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn mix_0c8c33() { + var res : vec3 = mix(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_0c8c33(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_0c8c33(); +} + +[[stage(compute)]] +fn compute_main() { + mix_0c8c33(); +} diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl new file mode 100644 index 0000000000..ff54cd21b6 --- /dev/null +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn mix_4f0b5e() { + var res: f32 = mix(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_4f0b5e(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_4f0b5e(); +} + +[[stage(compute)]] +fn compute_main() { + mix_4f0b5e(); +} diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl new file mode 100644 index 0000000000..0e0d6cf850 --- /dev/null +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void mix_4f0b5e() { + float res = lerp(1.0f, 1.0f, 1.0f); +} + +void vertex_main() { + mix_4f0b5e(); + return; +} + +void fragment_main() { + mix_4f0b5e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + mix_4f0b5e(); + return; +} + diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl new file mode 100644 index 0000000000..2ed9515099 --- /dev/null +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void mix_4f0b5e() { + float res = mix(1.0f, 1.0f, 1.0f); +} + +vertex void vertex_main() { + mix_4f0b5e(); + return; +} + +fragment void fragment_main() { + mix_4f0b5e(); + return; +} + +kernel void compute_main() { + mix_4f0b5e(); + return; +} + diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm new file mode 100644 index 0000000000..a35bde53f3 --- /dev/null +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %mix_4f0b5e "mix_4f0b5e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %mix_4f0b5e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 FMix %float_1 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %mix_4f0b5e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %mix_4f0b5e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %mix_4f0b5e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl new file mode 100644 index 0000000000..847669d6bd --- /dev/null +++ b/test/intrinsics/gen/mix/4f0b5e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn mix_4f0b5e() { + var res : f32 = mix(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_4f0b5e(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_4f0b5e(); +} + +[[stage(compute)]] +fn compute_main() { + mix_4f0b5e(); +} diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl new file mode 100644 index 0000000000..b38477c862 --- /dev/null +++ b/test/intrinsics/gen/mix/6f8adc.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn mix_6f8adc() { + var res: vec2 = mix(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_6f8adc(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_6f8adc(); +} + +[[stage(compute)]] +fn compute_main() { + mix_6f8adc(); +} diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl new file mode 100644 index 0000000000..dd8fa59c33 --- /dev/null +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void mix_6f8adc() { + float2 res = lerp(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + mix_6f8adc(); + return; +} + +void fragment_main() { + mix_6f8adc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + mix_6f8adc(); + return; +} + diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl new file mode 100644 index 0000000000..6e65e0361c --- /dev/null +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void mix_6f8adc() { + float2 res = mix(float2(), float2(), float2()); +} + +vertex void vertex_main() { + mix_6f8adc(); + return; +} + +fragment void fragment_main() { + mix_6f8adc(); + return; +} + +kernel void compute_main() { + mix_6f8adc(); + return; +} + diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm new file mode 100644 index 0000000000..ea47804fcf --- /dev/null +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %mix_6f8adc "mix_6f8adc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %mix_6f8adc = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 FMix %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %mix_6f8adc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %mix_6f8adc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %mix_6f8adc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl new file mode 100644 index 0000000000..7a2ae66162 --- /dev/null +++ b/test/intrinsics/gen/mix/6f8adc.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn mix_6f8adc() { + var res : vec2 = mix(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_6f8adc(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_6f8adc(); +} + +[[stage(compute)]] +fn compute_main() { + mix_6f8adc(); +} diff --git a/test/intrinsics/gen/mix/c37ede.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl new file mode 100644 index 0000000000..083fa4d18e --- /dev/null +++ b/test/intrinsics/gen/mix/c37ede.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn mix_c37ede() { + var res: vec4 = mix(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_c37ede(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_c37ede(); +} + +[[stage(compute)]] +fn compute_main() { + mix_c37ede(); +} diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl new file mode 100644 index 0000000000..e66be23ec9 --- /dev/null +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void mix_c37ede() { + float4 res = lerp(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + mix_c37ede(); + return; +} + +void fragment_main() { + mix_c37ede(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + mix_c37ede(); + return; +} + diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl new file mode 100644 index 0000000000..2da352e20f --- /dev/null +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void mix_c37ede() { + float4 res = mix(float4(), float4(), float4()); +} + +vertex void vertex_main() { + mix_c37ede(); + return; +} + +fragment void fragment_main() { + mix_c37ede(); + return; +} + +kernel void compute_main() { + mix_c37ede(); + return; +} + diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm new file mode 100644 index 0000000000..4277d148f8 --- /dev/null +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %mix_c37ede "mix_c37ede" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %mix_c37ede = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 FMix %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %mix_c37ede + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %mix_c37ede + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %mix_c37ede + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl new file mode 100644 index 0000000000..72a921b995 --- /dev/null +++ b/test/intrinsics/gen/mix/c37ede.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn mix_c37ede() { + var res : vec4 = mix(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + mix_c37ede(); +} + +[[stage(fragment)]] +fn fragment_main() { + mix_c37ede(); +} + +[[stage(compute)]] +fn compute_main() { + mix_c37ede(); +} diff --git a/test/intrinsics/gen/modf/8d6261.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl new file mode 100644 index 0000000000..fbc453deda --- /dev/null +++ b/test/intrinsics/gen/modf/8d6261.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn modf_8d6261() { + var arg_1: f32; + var res: f32 = modf(1.0, &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_8d6261(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_8d6261(); +} + +[[stage(compute)]] +fn compute_main() { + modf_8d6261(); +} diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl new file mode 100644 index 0000000000..ccd4c1ea08 --- /dev/null +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_8d6261() { + var arg_1 : f32; + var res : f32 = modf(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_8d6261(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_8d6261(); +} + +[[stage(compute)]] +fn compute_main() { + modf_8d6261(); +} + +Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl new file mode 100644 index 0000000000..8db3689689 --- /dev/null +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_8d6261() { + var arg_1 : f32; + var res : f32 = modf(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_8d6261(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_8d6261(); +} + +[[stage(compute)]] +fn compute_main() { + modf_8d6261(); +} + +Failed to generate: error: Unknown import method: modf diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm new file mode 100644 index 0000000000..ca34c913e3 --- /dev/null +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %12 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %modf_8d6261 "modf_8d6261" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%modf_8d6261 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_float Function %4 + %res = OpVariable %_ptr_Function_float Function %4 + %11 = OpExtInst %float %12 Modf %float_1 %arg_1 + OpStore %res %11 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %17 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %modf_8d6261 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %modf_8d6261 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %modf_8d6261 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl new file mode 100644 index 0000000000..2afc9f9c09 --- /dev/null +++ b/test/intrinsics/gen/modf/8d6261.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn modf_8d6261() { + var arg_1 : f32; + var res : f32 = modf(1.0, &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_8d6261(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_8d6261(); +} + +[[stage(compute)]] +fn compute_main() { + modf_8d6261(); +} diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl new file mode 100644 index 0000000000..c8fa7a7722 --- /dev/null +++ b/test/intrinsics/gen/modf/c82e3f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn modf_c82e3f() { + var arg_1: vec4; + var res: vec4 = modf(vec4(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_c82e3f(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_c82e3f(); +} + +[[stage(compute)]] +fn compute_main() { + modf_c82e3f(); +} diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl new file mode 100644 index 0000000000..f1508a036e --- /dev/null +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_c82e3f() { + var arg_1 : vec4; + var res : vec4 = modf(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_c82e3f(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_c82e3f(); +} + +[[stage(compute)]] +fn compute_main() { + modf_c82e3f(); +} + +Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl new file mode 100644 index 0000000000..a6f21e0520 --- /dev/null +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_c82e3f() { + var arg_1 : vec4; + var res : vec4 = modf(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_c82e3f(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_c82e3f(); +} + +[[stage(compute)]] +fn compute_main() { + modf_c82e3f(); +} + +Failed to generate: error: Unknown import method: modf diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm new file mode 100644 index 0000000000..e32d405be2 --- /dev/null +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %modf_c82e3f "modf_c82e3f" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %12 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%modf_c82e3f = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v4float Function %12 + %res = OpVariable %_ptr_Function_v4float Function %12 + %13 = OpExtInst %v4float %14 Modf %12 %arg_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %modf_c82e3f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %modf_c82e3f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %modf_c82e3f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl new file mode 100644 index 0000000000..17caaf064e --- /dev/null +++ b/test/intrinsics/gen/modf/c82e3f.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn modf_c82e3f() { + var arg_1 : vec4; + var res : vec4 = modf(vec4(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_c82e3f(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_c82e3f(); +} + +[[stage(compute)]] +fn compute_main() { + modf_c82e3f(); +} diff --git a/test/intrinsics/gen/modf/d62477.wgsl b/test/intrinsics/gen/modf/d62477.wgsl new file mode 100644 index 0000000000..a96fefe99a --- /dev/null +++ b/test/intrinsics/gen/modf/d62477.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn modf_d62477() { + var arg_1: vec2; + var res: vec2 = modf(vec2(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_d62477(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_d62477(); +} + +[[stage(compute)]] +fn compute_main() { + modf_d62477(); +} diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl new file mode 100644 index 0000000000..a70bf737c5 --- /dev/null +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_d62477() { + var arg_1 : vec2; + var res : vec2 = modf(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_d62477(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_d62477(); +} + +[[stage(compute)]] +fn compute_main() { + modf_d62477(); +} + +Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.msl b/test/intrinsics/gen/modf/d62477.wgsl.expected.msl new file mode 100644 index 0000000000..5d2cb3fc45 --- /dev/null +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_d62477() { + var arg_1 : vec2; + var res : vec2 = modf(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_d62477(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_d62477(); +} + +[[stage(compute)]] +fn compute_main() { + modf_d62477(); +} + +Failed to generate: error: Unknown import method: modf diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm new file mode 100644 index 0000000000..6f536e10b9 --- /dev/null +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %modf_d62477 "modf_d62477" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 +%_ptr_Function_v2float = OpTypePointer Function %v2float + %12 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%modf_d62477 = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v2float Function %12 + %res = OpVariable %_ptr_Function_v2float Function %12 + %13 = OpExtInst %v2float %14 Modf %12 %arg_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %modf_d62477 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %modf_d62477 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %modf_d62477 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl new file mode 100644 index 0000000000..0dd0dff241 --- /dev/null +++ b/test/intrinsics/gen/modf/d62477.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn modf_d62477() { + var arg_1 : vec2; + var res : vec2 = modf(vec2(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_d62477(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_d62477(); +} + +[[stage(compute)]] +fn compute_main() { + modf_d62477(); +} diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl new file mode 100644 index 0000000000..2127285c4c --- /dev/null +++ b/test/intrinsics/gen/modf/f9f98c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn modf_f9f98c() { + var arg_1: vec3; + var res: vec3 = modf(vec3(), &arg_1); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_f9f98c(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_f9f98c(); +} + +[[stage(compute)]] +fn compute_main() { + modf_f9f98c(); +} diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl new file mode 100644 index 0000000000..c55eb0c1b8 --- /dev/null +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_f9f98c() { + var arg_1 : vec3; + var res : vec3 = modf(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_f9f98c(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_f9f98c(); +} + +[[stage(compute)]] +fn compute_main() { + modf_f9f98c(); +} + +Failed to generate: error: Unknown builtin method: modf diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl new file mode 100644 index 0000000000..6ad9f9ee27 --- /dev/null +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.msl @@ -0,0 +1,24 @@ +SKIP: FAILED + + +fn modf_f9f98c() { + var arg_1 : vec3; + var res : vec3 = modf(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_f9f98c(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_f9f98c(); +} + +[[stage(compute)]] +fn compute_main() { + modf_f9f98c(); +} + +Failed to generate: error: Unknown import method: modf diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm new file mode 100644 index 0000000000..44dfbf85f8 --- /dev/null +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %14 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %modf_f9f98c "modf_f9f98c" + OpName %arg_1 "arg_1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 +%_ptr_Function_v3float = OpTypePointer Function %v3float + %12 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 +%modf_f9f98c = OpFunction %void None %5 + %8 = OpLabel + %arg_1 = OpVariable %_ptr_Function_v3float Function %12 + %res = OpVariable %_ptr_Function_v3float Function %12 + %13 = OpExtInst %v3float %14 Modf %12 %arg_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %modf_f9f98c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %modf_f9f98c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %modf_f9f98c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl new file mode 100644 index 0000000000..31d6412fb2 --- /dev/null +++ b/test/intrinsics/gen/modf/f9f98c.wgsl.expected.wgsl @@ -0,0 +1,19 @@ +fn modf_f9f98c() { + var arg_1 : vec3; + var res : vec3 = modf(vec3(), &(arg_1)); +} + +[[stage(vertex)]] +fn vertex_main() { + modf_f9f98c(); +} + +[[stage(fragment)]] +fn fragment_main() { + modf_f9f98c(); +} + +[[stage(compute)]] +fn compute_main() { + modf_f9f98c(); +} diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl new file mode 100644 index 0000000000..5cc727436e --- /dev/null +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn normalize_64d8c0() { + var res: vec3 = normalize(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_64d8c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_64d8c0(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_64d8c0(); +} diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl new file mode 100644 index 0000000000..c3c93d9676 --- /dev/null +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void normalize_64d8c0() { + float3 res = normalize(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + normalize_64d8c0(); + return; +} + +void fragment_main() { + normalize_64d8c0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + normalize_64d8c0(); + return; +} + diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl new file mode 100644 index 0000000000..63a1895058 --- /dev/null +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void normalize_64d8c0() { + float3 res = normalize(float3()); +} + +vertex void vertex_main() { + normalize_64d8c0(); + return; +} + +fragment void fragment_main() { + normalize_64d8c0(); + return; +} + +kernel void compute_main() { + normalize_64d8c0(); + return; +} + diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm new file mode 100644 index 0000000000..c3c10f9b0b --- /dev/null +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %normalize_64d8c0 "normalize_64d8c0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%normalize_64d8c0 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Normalize %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %normalize_64d8c0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %normalize_64d8c0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %normalize_64d8c0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl new file mode 100644 index 0000000000..39498457ea --- /dev/null +++ b/test/intrinsics/gen/normalize/64d8c0.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn normalize_64d8c0() { + var res : vec3 = normalize(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_64d8c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_64d8c0(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_64d8c0(); +} diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl new file mode 100644 index 0000000000..264049952b --- /dev/null +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn normalize_9a0aab() { + var res: vec4 = normalize(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_9a0aab(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_9a0aab(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_9a0aab(); +} diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl new file mode 100644 index 0000000000..064c75879a --- /dev/null +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void normalize_9a0aab() { + float4 res = normalize(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + normalize_9a0aab(); + return; +} + +void fragment_main() { + normalize_9a0aab(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + normalize_9a0aab(); + return; +} + diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl new file mode 100644 index 0000000000..84dc468490 --- /dev/null +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void normalize_9a0aab() { + float4 res = normalize(float4()); +} + +vertex void vertex_main() { + normalize_9a0aab(); + return; +} + +fragment void fragment_main() { + normalize_9a0aab(); + return; +} + +kernel void compute_main() { + normalize_9a0aab(); + return; +} + diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm new file mode 100644 index 0000000000..a261175cfa --- /dev/null +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %normalize_9a0aab "normalize_9a0aab" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%normalize_9a0aab = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Normalize %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %normalize_9a0aab + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %normalize_9a0aab + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %normalize_9a0aab + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl new file mode 100644 index 0000000000..979531fdb4 --- /dev/null +++ b/test/intrinsics/gen/normalize/9a0aab.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn normalize_9a0aab() { + var res : vec4 = normalize(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_9a0aab(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_9a0aab(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_9a0aab(); +} diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl new file mode 100644 index 0000000000..498bd96065 --- /dev/null +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn normalize_fc2ef1() { + var res: vec2 = normalize(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_fc2ef1(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_fc2ef1(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_fc2ef1(); +} diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl new file mode 100644 index 0000000000..aba2121733 --- /dev/null +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void normalize_fc2ef1() { + float2 res = normalize(float2(0.0f, 0.0f)); +} + +void vertex_main() { + normalize_fc2ef1(); + return; +} + +void fragment_main() { + normalize_fc2ef1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + normalize_fc2ef1(); + return; +} + diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl new file mode 100644 index 0000000000..6fb812869f --- /dev/null +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void normalize_fc2ef1() { + float2 res = normalize(float2()); +} + +vertex void vertex_main() { + normalize_fc2ef1(); + return; +} + +fragment void fragment_main() { + normalize_fc2ef1(); + return; +} + +kernel void compute_main() { + normalize_fc2ef1(); + return; +} + diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm new file mode 100644 index 0000000000..99cc6bdb7a --- /dev/null +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %normalize_fc2ef1 "normalize_fc2ef1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%normalize_fc2ef1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Normalize %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %normalize_fc2ef1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %normalize_fc2ef1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %normalize_fc2ef1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl new file mode 100644 index 0000000000..8c35391f48 --- /dev/null +++ b/test/intrinsics/gen/normalize/fc2ef1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn normalize_fc2ef1() { + var res : vec2 = normalize(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + normalize_fc2ef1(); +} + +[[stage(fragment)]] +fn fragment_main() { + normalize_fc2ef1(); +} + +[[stage(compute)]] +fn compute_main() { + normalize_fc2ef1(); +} diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl new file mode 100644 index 0000000000..8765662159 --- /dev/null +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pack2x16float_0e97b3() { + var res: u32 = pack2x16float(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16float_0e97b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16float_0e97b3(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16float_0e97b3(); +} diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl new file mode 100644 index 0000000000..c942222deb --- /dev/null +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void pack2x16float_0e97b3() { + uint2 tint_tmp = f32tof16(float2(0.0f, 0.0f)); +uint res = (tint_tmp.x | tint_tmp.y << 16); +} + +void vertex_main() { + pack2x16float_0e97b3(); + return; +} + +void fragment_main() { + pack2x16float_0e97b3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pack2x16float_0e97b3(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl new file mode 100644 index 0000000000..04b790d455 --- /dev/null +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pack2x16float_0e97b3() { + uint res = as_type(half2(float2())); +} + +vertex void vertex_main() { + pack2x16float_0e97b3(); + return; +} + +fragment void fragment_main() { + pack2x16float_0e97b3(); + return; +} + +kernel void compute_main() { + pack2x16float_0e97b3(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm new file mode 100644 index 0000000000..c8eac8bea4 --- /dev/null +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pack2x16float_0e97b3 "pack2x16float_0e97b3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%pack2x16float_0e97b3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpExtInst %uint %11 PackHalf2x16 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %pack2x16float_0e97b3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %pack2x16float_0e97b3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %pack2x16float_0e97b3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl new file mode 100644 index 0000000000..d4d2b137c4 --- /dev/null +++ b/test/intrinsics/gen/pack2x16float/0e97b3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pack2x16float_0e97b3() { + var res : u32 = pack2x16float(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16float_0e97b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16float_0e97b3(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16float_0e97b3(); +} diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl new file mode 100644 index 0000000000..1ce08a3f17 --- /dev/null +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pack2x16snorm_6c169b() { + var res: u32 = pack2x16snorm(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16snorm_6c169b(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16snorm_6c169b(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16snorm_6c169b(); +} diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl new file mode 100644 index 0000000000..f8db4b3eea --- /dev/null +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void pack2x16snorm_6c169b() { + int2 tint_tmp = int2(round(clamp(float2(0.0f, 0.0f), -1.0, 1.0) * 32767.0)) & 0xffff; +uint res = asuint(tint_tmp.x | tint_tmp.y << 16); +} + +void vertex_main() { + pack2x16snorm_6c169b(); + return; +} + +void fragment_main() { + pack2x16snorm_6c169b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pack2x16snorm_6c169b(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl new file mode 100644 index 0000000000..744c4b48c2 --- /dev/null +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pack2x16snorm_6c169b() { + uint res = pack_float_to_snorm2x16(float2()); +} + +vertex void vertex_main() { + pack2x16snorm_6c169b(); + return; +} + +fragment void fragment_main() { + pack2x16snorm_6c169b(); + return; +} + +kernel void compute_main() { + pack2x16snorm_6c169b(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm new file mode 100644 index 0000000000..73ea23a11c --- /dev/null +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pack2x16snorm_6c169b "pack2x16snorm_6c169b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%pack2x16snorm_6c169b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpExtInst %uint %11 PackSnorm2x16 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %pack2x16snorm_6c169b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %pack2x16snorm_6c169b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %pack2x16snorm_6c169b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl new file mode 100644 index 0000000000..33b7961e25 --- /dev/null +++ b/test/intrinsics/gen/pack2x16snorm/6c169b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pack2x16snorm_6c169b() { + var res : u32 = pack2x16snorm(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16snorm_6c169b(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16snorm_6c169b(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16snorm_6c169b(); +} diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl new file mode 100644 index 0000000000..7e28d98b6a --- /dev/null +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pack2x16unorm_0f08e4() { + var res: u32 = pack2x16unorm(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16unorm_0f08e4(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16unorm_0f08e4(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16unorm_0f08e4(); +} diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl new file mode 100644 index 0000000000..4893f30672 --- /dev/null +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void pack2x16unorm_0f08e4() { + uint2 tint_tmp = uint2(round(clamp(float2(0.0f, 0.0f), 0.0, 1.0) * 65535.0)); +uint res = (tint_tmp.x | tint_tmp.y << 16); +} + +void vertex_main() { + pack2x16unorm_0f08e4(); + return; +} + +void fragment_main() { + pack2x16unorm_0f08e4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pack2x16unorm_0f08e4(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl new file mode 100644 index 0000000000..4032c7aef9 --- /dev/null +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pack2x16unorm_0f08e4() { + uint res = pack_float_to_unorm2x16(float2()); +} + +vertex void vertex_main() { + pack2x16unorm_0f08e4(); + return; +} + +fragment void fragment_main() { + pack2x16unorm_0f08e4(); + return; +} + +kernel void compute_main() { + pack2x16unorm_0f08e4(); + return; +} + diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm new file mode 100644 index 0000000000..bdd07e723c --- /dev/null +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pack2x16unorm_0f08e4 "pack2x16unorm_0f08e4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2float = OpTypeVector %float 2 + %13 = OpConstantNull %v2float +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%pack2x16unorm_0f08e4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpExtInst %uint %11 PackUnorm2x16 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %pack2x16unorm_0f08e4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %pack2x16unorm_0f08e4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %pack2x16unorm_0f08e4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl new file mode 100644 index 0000000000..50a1f43c52 --- /dev/null +++ b/test/intrinsics/gen/pack2x16unorm/0f08e4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pack2x16unorm_0f08e4() { + var res : u32 = pack2x16unorm(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack2x16unorm_0f08e4(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack2x16unorm_0f08e4(); +} + +[[stage(compute)]] +fn compute_main() { + pack2x16unorm_0f08e4(); +} diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl new file mode 100644 index 0000000000..926a674868 --- /dev/null +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pack4x8snorm_4d22e7() { + var res: u32 = pack4x8snorm(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack4x8snorm_4d22e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack4x8snorm_4d22e7(); +} + +[[stage(compute)]] +fn compute_main() { + pack4x8snorm_4d22e7(); +} diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl new file mode 100644 index 0000000000..fdb571fe29 --- /dev/null +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void pack4x8snorm_4d22e7() { + int4 tint_tmp = int4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), -1.0, 1.0) * 127.0)) & 0xff; +uint res = asuint(tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24); +} + +void vertex_main() { + pack4x8snorm_4d22e7(); + return; +} + +void fragment_main() { + pack4x8snorm_4d22e7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pack4x8snorm_4d22e7(); + return; +} + diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl new file mode 100644 index 0000000000..29469ceee8 --- /dev/null +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pack4x8snorm_4d22e7() { + uint res = pack_float_to_snorm4x8(float4()); +} + +vertex void vertex_main() { + pack4x8snorm_4d22e7(); + return; +} + +fragment void fragment_main() { + pack4x8snorm_4d22e7(); + return; +} + +kernel void compute_main() { + pack4x8snorm_4d22e7(); + return; +} + diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm new file mode 100644 index 0000000000..14c3fed7b9 --- /dev/null +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pack4x8snorm_4d22e7 "pack4x8snorm_4d22e7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%pack4x8snorm_4d22e7 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpExtInst %uint %11 PackSnorm4x8 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %pack4x8snorm_4d22e7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %pack4x8snorm_4d22e7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %pack4x8snorm_4d22e7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl new file mode 100644 index 0000000000..f004930b8a --- /dev/null +++ b/test/intrinsics/gen/pack4x8snorm/4d22e7.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pack4x8snorm_4d22e7() { + var res : u32 = pack4x8snorm(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack4x8snorm_4d22e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack4x8snorm_4d22e7(); +} + +[[stage(compute)]] +fn compute_main() { + pack4x8snorm_4d22e7(); +} diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl new file mode 100644 index 0000000000..7d2487596e --- /dev/null +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pack4x8unorm_95c456() { + var res: u32 = pack4x8unorm(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack4x8unorm_95c456(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack4x8unorm_95c456(); +} + +[[stage(compute)]] +fn compute_main() { + pack4x8unorm_95c456(); +} diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl new file mode 100644 index 0000000000..d28797ecf8 --- /dev/null +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void pack4x8unorm_95c456() { + uint4 tint_tmp = uint4(round(clamp(float4(0.0f, 0.0f, 0.0f, 0.0f), 0.0, 1.0) * 255.0)); +uint res = (tint_tmp.x | tint_tmp.y << 8 | tint_tmp.z << 16 | tint_tmp.w << 24); +} + +void vertex_main() { + pack4x8unorm_95c456(); + return; +} + +void fragment_main() { + pack4x8unorm_95c456(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pack4x8unorm_95c456(); + return; +} + diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl new file mode 100644 index 0000000000..0871406087 --- /dev/null +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pack4x8unorm_95c456() { + uint res = pack_float_to_unorm4x8(float4()); +} + +vertex void vertex_main() { + pack4x8unorm_95c456(); + return; +} + +fragment void fragment_main() { + pack4x8unorm_95c456(); + return; +} + +kernel void compute_main() { + pack4x8unorm_95c456(); + return; +} + diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm new file mode 100644 index 0000000000..2dd4c33e61 --- /dev/null +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pack4x8unorm_95c456 "pack4x8unorm_95c456" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4float = OpTypeVector %float 4 + %13 = OpConstantNull %v4float +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%pack4x8unorm_95c456 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpExtInst %uint %11 PackUnorm4x8 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %pack4x8unorm_95c456 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %pack4x8unorm_95c456 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %pack4x8unorm_95c456 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl new file mode 100644 index 0000000000..1b296f9e0b --- /dev/null +++ b/test/intrinsics/gen/pack4x8unorm/95c456.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pack4x8unorm_95c456() { + var res : u32 = pack4x8unorm(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pack4x8unorm_95c456(); +} + +[[stage(fragment)]] +fn fragment_main() { + pack4x8unorm_95c456(); +} + +[[stage(compute)]] +fn compute_main() { + pack4x8unorm_95c456(); +} diff --git a/test/intrinsics/gen/pow/04a908.wgsl b/test/intrinsics/gen/pow/04a908.wgsl new file mode 100644 index 0000000000..c91e6cfbdd --- /dev/null +++ b/test/intrinsics/gen/pow/04a908.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pow_04a908() { + var res: vec4 = pow(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_04a908(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_04a908(); +} + +[[stage(compute)]] +fn compute_main() { + pow_04a908(); +} diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl new file mode 100644 index 0000000000..ad542353d8 --- /dev/null +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void pow_04a908() { + float4 res = pow(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + pow_04a908(); + return; +} + +void fragment_main() { + pow_04a908(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pow_04a908(); + return; +} + diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.msl b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl new file mode 100644 index 0000000000..228e56f466 --- /dev/null +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pow_04a908() { + float4 res = pow(float4(), float4()); +} + +vertex void vertex_main() { + pow_04a908(); + return; +} + +fragment void fragment_main() { + pow_04a908(); + return; +} + +kernel void compute_main() { + pow_04a908(); + return; +} + diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm new file mode 100644 index 0000000000..ac6771982d --- /dev/null +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pow_04a908 "pow_04a908" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %pow_04a908 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Pow %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %pow_04a908 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %pow_04a908 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %pow_04a908 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl new file mode 100644 index 0000000000..cbbf4b798d --- /dev/null +++ b/test/intrinsics/gen/pow/04a908.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pow_04a908() { + var res : vec4 = pow(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_04a908(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_04a908(); +} + +[[stage(compute)]] +fn compute_main() { + pow_04a908(); +} diff --git a/test/intrinsics/gen/pow/46e029.wgsl b/test/intrinsics/gen/pow/46e029.wgsl new file mode 100644 index 0000000000..b373967673 --- /dev/null +++ b/test/intrinsics/gen/pow/46e029.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pow_46e029() { + var res: f32 = pow(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_46e029(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_46e029(); +} + +[[stage(compute)]] +fn compute_main() { + pow_46e029(); +} diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl new file mode 100644 index 0000000000..193aaeaaec --- /dev/null +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void pow_46e029() { + float res = pow(1.0f, 1.0f); +} + +void vertex_main() { + pow_46e029(); + return; +} + +void fragment_main() { + pow_46e029(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pow_46e029(); + return; +} + diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.msl b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl new file mode 100644 index 0000000000..22cdf1fd96 --- /dev/null +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pow_46e029() { + float res = pow(1.0f, 1.0f); +} + +vertex void vertex_main() { + pow_46e029(); + return; +} + +fragment void fragment_main() { + pow_46e029(); + return; +} + +kernel void compute_main() { + pow_46e029(); + return; +} + diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm new file mode 100644 index 0000000000..030a77e501 --- /dev/null +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pow_46e029 "pow_46e029" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %pow_46e029 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Pow %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %pow_46e029 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %pow_46e029 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %pow_46e029 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl new file mode 100644 index 0000000000..6aae69e836 --- /dev/null +++ b/test/intrinsics/gen/pow/46e029.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pow_46e029() { + var res : f32 = pow(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_46e029(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_46e029(); +} + +[[stage(compute)]] +fn compute_main() { + pow_46e029(); +} diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl new file mode 100644 index 0000000000..cf1801d44e --- /dev/null +++ b/test/intrinsics/gen/pow/4a46c9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pow_4a46c9() { + var res: vec3 = pow(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_4a46c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_4a46c9(); +} + +[[stage(compute)]] +fn compute_main() { + pow_4a46c9(); +} diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl new file mode 100644 index 0000000000..4b79a217bf --- /dev/null +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void pow_4a46c9() { + float3 res = pow(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + pow_4a46c9(); + return; +} + +void fragment_main() { + pow_4a46c9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pow_4a46c9(); + return; +} + diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl new file mode 100644 index 0000000000..e518b163ee --- /dev/null +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pow_4a46c9() { + float3 res = pow(float3(), float3()); +} + +vertex void vertex_main() { + pow_4a46c9(); + return; +} + +fragment void fragment_main() { + pow_4a46c9(); + return; +} + +kernel void compute_main() { + pow_4a46c9(); + return; +} + diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm new file mode 100644 index 0000000000..3ba1ee0a9d --- /dev/null +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pow_4a46c9 "pow_4a46c9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %pow_4a46c9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Pow %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %pow_4a46c9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %pow_4a46c9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %pow_4a46c9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl new file mode 100644 index 0000000000..c789baa72c --- /dev/null +++ b/test/intrinsics/gen/pow/4a46c9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pow_4a46c9() { + var res : vec3 = pow(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_4a46c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_4a46c9(); +} + +[[stage(compute)]] +fn compute_main() { + pow_4a46c9(); +} diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl new file mode 100644 index 0000000000..ad3bb6cf8f --- /dev/null +++ b/test/intrinsics/gen/pow/e60ea5.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn pow_e60ea5() { + var res: vec2 = pow(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_e60ea5(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_e60ea5(); +} + +[[stage(compute)]] +fn compute_main() { + pow_e60ea5(); +} diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl new file mode 100644 index 0000000000..b03968bf65 --- /dev/null +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void pow_e60ea5() { + float2 res = pow(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + pow_e60ea5(); + return; +} + +void fragment_main() { + pow_e60ea5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + pow_e60ea5(); + return; +} + diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl new file mode 100644 index 0000000000..d957e7637e --- /dev/null +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void pow_e60ea5() { + float2 res = pow(float2(), float2()); +} + +vertex void vertex_main() { + pow_e60ea5(); + return; +} + +fragment void fragment_main() { + pow_e60ea5(); + return; +} + +kernel void compute_main() { + pow_e60ea5(); + return; +} + diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm new file mode 100644 index 0000000000..8aeb680b66 --- /dev/null +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %pow_e60ea5 "pow_e60ea5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %pow_e60ea5 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Pow %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %pow_e60ea5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %pow_e60ea5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %pow_e60ea5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl new file mode 100644 index 0000000000..d8c2cb6a1a --- /dev/null +++ b/test/intrinsics/gen/pow/e60ea5.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn pow_e60ea5() { + var res : vec2 = pow(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + pow_e60ea5(); +} + +[[stage(fragment)]] +fn fragment_main() { + pow_e60ea5(); +} + +[[stage(compute)]] +fn compute_main() { + pow_e60ea5(); +} diff --git a/test/intrinsics/gen/reflect/05357e.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl new file mode 100644 index 0000000000..79795c5339 --- /dev/null +++ b/test/intrinsics/gen/reflect/05357e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reflect_05357e() { + var res: vec4 = reflect(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_05357e(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_05357e(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_05357e(); +} diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl new file mode 100644 index 0000000000..8b788a25a5 --- /dev/null +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reflect_05357e() { + float4 res = reflect(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + reflect_05357e(); + return; +} + +void fragment_main() { + reflect_05357e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reflect_05357e(); + return; +} + diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl new file mode 100644 index 0000000000..22542302bb --- /dev/null +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reflect_05357e() { + float4 res = reflect(float4(), float4()); +} + +vertex void vertex_main() { + reflect_05357e(); + return; +} + +fragment void fragment_main() { + reflect_05357e(); + return; +} + +kernel void compute_main() { + reflect_05357e(); + return; +} + diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm new file mode 100644 index 0000000000..5326fc6490 --- /dev/null +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reflect_05357e "reflect_05357e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%reflect_05357e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Reflect %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reflect_05357e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reflect_05357e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reflect_05357e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl new file mode 100644 index 0000000000..579584818e --- /dev/null +++ b/test/intrinsics/gen/reflect/05357e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reflect_05357e() { + var res : vec4 = reflect(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_05357e(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_05357e(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_05357e(); +} diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl new file mode 100644 index 0000000000..ce35141f2d --- /dev/null +++ b/test/intrinsics/gen/reflect/b61e10.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reflect_b61e10() { + var res: vec2 = reflect(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_b61e10(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_b61e10(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_b61e10(); +} diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl new file mode 100644 index 0000000000..57643e7203 --- /dev/null +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reflect_b61e10() { + float2 res = reflect(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + reflect_b61e10(); + return; +} + +void fragment_main() { + reflect_b61e10(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reflect_b61e10(); + return; +} + diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl new file mode 100644 index 0000000000..a810e76cce --- /dev/null +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reflect_b61e10() { + float2 res = reflect(float2(), float2()); +} + +vertex void vertex_main() { + reflect_b61e10(); + return; +} + +fragment void fragment_main() { + reflect_b61e10(); + return; +} + +kernel void compute_main() { + reflect_b61e10(); + return; +} + diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm new file mode 100644 index 0000000000..9e75c2361e --- /dev/null +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reflect_b61e10 "reflect_b61e10" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%reflect_b61e10 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Reflect %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reflect_b61e10 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reflect_b61e10 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reflect_b61e10 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl new file mode 100644 index 0000000000..69cebff0ff --- /dev/null +++ b/test/intrinsics/gen/reflect/b61e10.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reflect_b61e10() { + var res : vec2 = reflect(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_b61e10(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_b61e10(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_b61e10(); +} diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl new file mode 100644 index 0000000000..81ce08e68c --- /dev/null +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reflect_f47fdb() { + var res: vec3 = reflect(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_f47fdb(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_f47fdb(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_f47fdb(); +} diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl new file mode 100644 index 0000000000..f48fec25ea --- /dev/null +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reflect_f47fdb() { + float3 res = reflect(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + reflect_f47fdb(); + return; +} + +void fragment_main() { + reflect_f47fdb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reflect_f47fdb(); + return; +} + diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl new file mode 100644 index 0000000000..d710cf2632 --- /dev/null +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reflect_f47fdb() { + float3 res = reflect(float3(), float3()); +} + +vertex void vertex_main() { + reflect_f47fdb(); + return; +} + +fragment void fragment_main() { + reflect_f47fdb(); + return; +} + +kernel void compute_main() { + reflect_f47fdb(); + return; +} + diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm new file mode 100644 index 0000000000..6b71c48cde --- /dev/null +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reflect_f47fdb "reflect_f47fdb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%reflect_f47fdb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Reflect %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reflect_f47fdb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reflect_f47fdb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reflect_f47fdb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl new file mode 100644 index 0000000000..68fdf25be3 --- /dev/null +++ b/test/intrinsics/gen/reflect/f47fdb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reflect_f47fdb() { + var res : vec3 = reflect(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_f47fdb(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_f47fdb(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_f47fdb(); +} diff --git a/test/intrinsics/gen/reflect/feae90.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl new file mode 100644 index 0000000000..cd1ef9f50f --- /dev/null +++ b/test/intrinsics/gen/reflect/feae90.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reflect_feae90() { + var res: f32 = reflect(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_feae90(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_feae90(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_feae90(); +} diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl new file mode 100644 index 0000000000..9be6d7bc17 --- /dev/null +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reflect_feae90() { + float res = reflect(1.0f, 1.0f); +} + +void vertex_main() { + reflect_feae90(); + return; +} + +void fragment_main() { + reflect_feae90(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reflect_feae90(); + return; +} + diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl new file mode 100644 index 0000000000..e6523fc27a --- /dev/null +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.msl @@ -0,0 +1,50 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void reflect_feae90() { + float res = reflect(1.0f, 1.0f); +} + +vertex void vertex_main() { + reflect_feae90(); + return; +} + +fragment void fragment_main() { + reflect_feae90(); + return; +} + +kernel void compute_main() { + reflect_feae90(); + return; +} + + +tint_ib1Pi6.metal:5:17: error: call to 'reflect' is ambiguous + float res = reflect(1.0f, 1.0f); + ^~~~~~~ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:315:18: note: candidate function +METAL_FUNC half2 reflect(half2 i, half2 n) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:346:18: note: candidate function +METAL_FUNC half3 reflect(half3 i, half3 n) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:377:18: note: candidate function +METAL_FUNC half4 reflect(half4 i, half4 n) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:420:19: note: candidate function +METAL_FUNC float2 reflect(float2 i, float2 n) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:463:19: note: candidate function +METAL_FUNC float3 reflect(float3 i, float3 n) + ^ +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/macos/lib/clang/902.14/include/metal/metal_geometric:506:19: note: candidate function +METAL_FUNC float4 reflect(float4 i, float4 n) + ^ +1 error generated. diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm new file mode 100644 index 0000000000..f8f068078e --- /dev/null +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reflect_feae90 "reflect_feae90" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%reflect_feae90 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Reflect %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %reflect_feae90 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %reflect_feae90 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %reflect_feae90 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl new file mode 100644 index 0000000000..7b3a23bd8e --- /dev/null +++ b/test/intrinsics/gen/reflect/feae90.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reflect_feae90() { + var res : f32 = reflect(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + reflect_feae90(); +} + +[[stage(fragment)]] +fn fragment_main() { + reflect_feae90(); +} + +[[stage(compute)]] +fn compute_main() { + reflect_feae90(); +} diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl new file mode 100644 index 0000000000..01dc2895e1 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/222177.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_222177() { + var res: vec2 = reverseBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_222177(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_222177(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_222177(); +} diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl new file mode 100644 index 0000000000..f4c8e996a2 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_222177() { + int2 res = reversebits(int2(0, 0)); +} + +void vertex_main() { + reverseBits_222177(); + return; +} + +void fragment_main() { + reverseBits_222177(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_222177(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl new file mode 100644 index 0000000000..e4cc0b352b --- /dev/null +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_222177() { + int2 res = reverse_bits(int2()); +} + +vertex void vertex_main() { + reverseBits_222177(); + return; +} + +fragment void fragment_main() { + reverseBits_222177(); + return; +} + +kernel void compute_main() { + reverseBits_222177(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm new file mode 100644 index 0000000000..f180cb133c --- /dev/null +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_222177 "reverseBits_222177" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %12 = OpConstantNull %v2int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 +%reverseBits_222177 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %12 + %9 = OpBitReverse %v2int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_222177 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_222177 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_222177 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl new file mode 100644 index 0000000000..bf364aa03a --- /dev/null +++ b/test/intrinsics/gen/reverseBits/222177.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_222177() { + var res : vec2 = reverseBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_222177(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_222177(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_222177(); +} diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl new file mode 100644 index 0000000000..4a85781a7b --- /dev/null +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_35fea9() { + var res: vec4 = reverseBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_35fea9(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_35fea9(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_35fea9(); +} diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl new file mode 100644 index 0000000000..da3cf17b3d --- /dev/null +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_35fea9() { + uint4 res = reversebits(uint4(0u, 0u, 0u, 0u)); +} + +void vertex_main() { + reverseBits_35fea9(); + return; +} + +void fragment_main() { + reverseBits_35fea9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_35fea9(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl new file mode 100644 index 0000000000..7aea816b3c --- /dev/null +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_35fea9() { + uint4 res = reverse_bits(uint4()); +} + +vertex void vertex_main() { + reverseBits_35fea9(); + return; +} + +fragment void fragment_main() { + reverseBits_35fea9(); + return; +} + +kernel void compute_main() { + reverseBits_35fea9(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm new file mode 100644 index 0000000000..114d8da7f4 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_35fea9 "reverseBits_35fea9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %12 = OpConstantNull %v4uint +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 +%reverseBits_35fea9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %12 + %9 = OpBitReverse %v4uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_35fea9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_35fea9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_35fea9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl new file mode 100644 index 0000000000..850bc8fa3e --- /dev/null +++ b/test/intrinsics/gen/reverseBits/35fea9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_35fea9() { + var res : vec4 = reverseBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_35fea9(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_35fea9(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_35fea9(); +} diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl new file mode 100644 index 0000000000..ecb88511aa --- /dev/null +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_4dbd6f() { + var res: vec4 = reverseBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_4dbd6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_4dbd6f(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_4dbd6f(); +} diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl new file mode 100644 index 0000000000..3d0d9f8654 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_4dbd6f() { + int4 res = reversebits(int4(0, 0, 0, 0)); +} + +void vertex_main() { + reverseBits_4dbd6f(); + return; +} + +void fragment_main() { + reverseBits_4dbd6f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_4dbd6f(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl new file mode 100644 index 0000000000..f73e0c68cd --- /dev/null +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_4dbd6f() { + int4 res = reverse_bits(int4()); +} + +vertex void vertex_main() { + reverseBits_4dbd6f(); + return; +} + +fragment void fragment_main() { + reverseBits_4dbd6f(); + return; +} + +kernel void compute_main() { + reverseBits_4dbd6f(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm new file mode 100644 index 0000000000..35d075fa4d --- /dev/null +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_4dbd6f "reverseBits_4dbd6f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %12 = OpConstantNull %v4int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 +%reverseBits_4dbd6f = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %12 + %9 = OpBitReverse %v4int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_4dbd6f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_4dbd6f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_4dbd6f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl new file mode 100644 index 0000000000..282a3c5d0d --- /dev/null +++ b/test/intrinsics/gen/reverseBits/4dbd6f.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_4dbd6f() { + var res : vec4 = reverseBits(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_4dbd6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_4dbd6f(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_4dbd6f(); +} diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl new file mode 100644 index 0000000000..3528f06c6f --- /dev/null +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_7c4269() { + var res: i32 = reverseBits(1); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_7c4269(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_7c4269(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_7c4269(); +} diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl new file mode 100644 index 0000000000..871fbfc021 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_7c4269() { + int res = reversebits(1); +} + +void vertex_main() { + reverseBits_7c4269(); + return; +} + +void fragment_main() { + reverseBits_7c4269(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_7c4269(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl new file mode 100644 index 0000000000..07d35098ae --- /dev/null +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_7c4269() { + int res = reverse_bits(1); +} + +vertex void vertex_main() { + reverseBits_7c4269(); + return; +} + +fragment void fragment_main() { + reverseBits_7c4269(); + return; +} + +kernel void compute_main() { + reverseBits_7c4269(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm new file mode 100644 index 0000000000..c7b168a44d --- /dev/null +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_7c4269 "reverseBits_7c4269" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_int = OpTypePointer Function %int + %14 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%reverseBits_7c4269 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %14 + %9 = OpBitReverse %int %int_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_7c4269 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_7c4269 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_7c4269 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl new file mode 100644 index 0000000000..3571b73235 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/7c4269.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_7c4269() { + var res : i32 = reverseBits(1); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_7c4269(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_7c4269(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_7c4269(); +} diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl new file mode 100644 index 0000000000..960cb70258 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_a6ccd4() { + var res: vec3 = reverseBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_a6ccd4(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_a6ccd4(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_a6ccd4(); +} diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl new file mode 100644 index 0000000000..8a1535464c --- /dev/null +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_a6ccd4() { + uint3 res = reversebits(uint3(0u, 0u, 0u)); +} + +void vertex_main() { + reverseBits_a6ccd4(); + return; +} + +void fragment_main() { + reverseBits_a6ccd4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_a6ccd4(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl new file mode 100644 index 0000000000..73b5497476 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_a6ccd4() { + uint3 res = reverse_bits(uint3()); +} + +vertex void vertex_main() { + reverseBits_a6ccd4(); + return; +} + +fragment void fragment_main() { + reverseBits_a6ccd4(); + return; +} + +kernel void compute_main() { + reverseBits_a6ccd4(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm new file mode 100644 index 0000000000..51617d422a --- /dev/null +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_a6ccd4 "reverseBits_a6ccd4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %12 = OpConstantNull %v3uint +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 +%reverseBits_a6ccd4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %12 + %9 = OpBitReverse %v3uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_a6ccd4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_a6ccd4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_a6ccd4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl new file mode 100644 index 0000000000..118301be79 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/a6ccd4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_a6ccd4() { + var res : vec3 = reverseBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_a6ccd4(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_a6ccd4(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_a6ccd4(); +} diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl new file mode 100644 index 0000000000..aab692d4a3 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_c21bc1() { + var res: vec3 = reverseBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_c21bc1(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_c21bc1(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_c21bc1(); +} diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl new file mode 100644 index 0000000000..fcf618a623 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_c21bc1() { + int3 res = reversebits(int3(0, 0, 0)); +} + +void vertex_main() { + reverseBits_c21bc1(); + return; +} + +void fragment_main() { + reverseBits_c21bc1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_c21bc1(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl new file mode 100644 index 0000000000..45aa86ee25 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_c21bc1() { + int3 res = reverse_bits(int3()); +} + +vertex void vertex_main() { + reverseBits_c21bc1(); + return; +} + +fragment void fragment_main() { + reverseBits_c21bc1(); + return; +} + +kernel void compute_main() { + reverseBits_c21bc1(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm new file mode 100644 index 0000000000..1f247214d8 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_c21bc1 "reverseBits_c21bc1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %12 = OpConstantNull %v3int +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 +%reverseBits_c21bc1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %12 + %9 = OpBitReverse %v3int %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_c21bc1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_c21bc1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_c21bc1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl new file mode 100644 index 0000000000..adb06dabc3 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/c21bc1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_c21bc1() { + var res : vec3 = reverseBits(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_c21bc1(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_c21bc1(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_c21bc1(); +} diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl new file mode 100644 index 0000000000..238cba0fc8 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_e1f4c1() { + var res: vec2 = reverseBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_e1f4c1(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_e1f4c1(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_e1f4c1(); +} diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl new file mode 100644 index 0000000000..faf8a4930e --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_e1f4c1() { + uint2 res = reversebits(uint2(0u, 0u)); +} + +void vertex_main() { + reverseBits_e1f4c1(); + return; +} + +void fragment_main() { + reverseBits_e1f4c1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_e1f4c1(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl new file mode 100644 index 0000000000..7c2a68574c --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_e1f4c1() { + uint2 res = reverse_bits(uint2()); +} + +vertex void vertex_main() { + reverseBits_e1f4c1(); + return; +} + +fragment void fragment_main() { + reverseBits_e1f4c1(); + return; +} + +kernel void compute_main() { + reverseBits_e1f4c1(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm new file mode 100644 index 0000000000..35a6db00cf --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_e1f4c1 "reverseBits_e1f4c1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %12 = OpConstantNull %v2uint +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 +%reverseBits_e1f4c1 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %12 + %9 = OpBitReverse %v2uint %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_e1f4c1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_e1f4c1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_e1f4c1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl new file mode 100644 index 0000000000..7676c94b76 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e1f4c1.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_e1f4c1() { + var res : vec2 = reverseBits(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_e1f4c1(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_e1f4c1(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_e1f4c1(); +} diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl new file mode 100644 index 0000000000..6f8855dd20 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn reverseBits_e31adf() { + var res: u32 = reverseBits(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_e31adf(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_e31adf(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_e31adf(); +} diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl new file mode 100644 index 0000000000..245c726bea --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void reverseBits_e31adf() { + uint res = reversebits(1u); +} + +void vertex_main() { + reverseBits_e31adf(); + return; +} + +void fragment_main() { + reverseBits_e31adf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + reverseBits_e31adf(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl new file mode 100644 index 0000000000..eb2b65cf02 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void reverseBits_e31adf() { + uint res = reverse_bits(1u); +} + +vertex void vertex_main() { + reverseBits_e31adf(); + return; +} + +fragment void fragment_main() { + reverseBits_e31adf(); + return; +} + +kernel void compute_main() { + reverseBits_e31adf(); + return; +} + diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm new file mode 100644 index 0000000000..d9e3f25670 --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %reverseBits_e31adf "reverseBits_e31adf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint + %14 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%reverseBits_e31adf = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %14 + %9 = OpBitReverse %uint %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %reverseBits_e31adf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %reverseBits_e31adf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %reverseBits_e31adf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl new file mode 100644 index 0000000000..c3a3a4829a --- /dev/null +++ b/test/intrinsics/gen/reverseBits/e31adf.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn reverseBits_e31adf() { + var res : u32 = reverseBits(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + reverseBits_e31adf(); +} + +[[stage(fragment)]] +fn fragment_main() { + reverseBits_e31adf(); +} + +[[stage(compute)]] +fn compute_main() { + reverseBits_e31adf(); +} diff --git a/test/intrinsics/gen/round/106c0b.wgsl b/test/intrinsics/gen/round/106c0b.wgsl new file mode 100644 index 0000000000..d8b36ba729 --- /dev/null +++ b/test/intrinsics/gen/round/106c0b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn round_106c0b() { + var res: vec4 = round(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_106c0b(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_106c0b(); +} + +[[stage(compute)]] +fn compute_main() { + round_106c0b(); +} diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl new file mode 100644 index 0000000000..1d5a479d24 --- /dev/null +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void round_106c0b() { + float4 res = round(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + round_106c0b(); + return; +} + +void fragment_main() { + round_106c0b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + round_106c0b(); + return; +} + diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.msl b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl new file mode 100644 index 0000000000..460fcfa923 --- /dev/null +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void round_106c0b() { + float4 res = rint(float4()); +} + +vertex void vertex_main() { + round_106c0b(); + return; +} + +fragment void fragment_main() { + round_106c0b(); + return; +} + +kernel void compute_main() { + round_106c0b(); + return; +} + diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm new file mode 100644 index 0000000000..1a456628ca --- /dev/null +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %round_106c0b "round_106c0b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%round_106c0b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 RoundEven %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %round_106c0b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %round_106c0b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %round_106c0b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl new file mode 100644 index 0000000000..454fbb125f --- /dev/null +++ b/test/intrinsics/gen/round/106c0b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn round_106c0b() { + var res : vec4 = round(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_106c0b(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_106c0b(); +} + +[[stage(compute)]] +fn compute_main() { + round_106c0b(); +} diff --git a/test/intrinsics/gen/round/1c7897.wgsl b/test/intrinsics/gen/round/1c7897.wgsl new file mode 100644 index 0000000000..48f1a1f955 --- /dev/null +++ b/test/intrinsics/gen/round/1c7897.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn round_1c7897() { + var res: vec3 = round(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_1c7897(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_1c7897(); +} + +[[stage(compute)]] +fn compute_main() { + round_1c7897(); +} diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl new file mode 100644 index 0000000000..ca4d1b895a --- /dev/null +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void round_1c7897() { + float3 res = round(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + round_1c7897(); + return; +} + +void fragment_main() { + round_1c7897(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + round_1c7897(); + return; +} + diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.msl b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl new file mode 100644 index 0000000000..567828b2d8 --- /dev/null +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void round_1c7897() { + float3 res = rint(float3()); +} + +vertex void vertex_main() { + round_1c7897(); + return; +} + +fragment void fragment_main() { + round_1c7897(); + return; +} + +kernel void compute_main() { + round_1c7897(); + return; +} + diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm new file mode 100644 index 0000000000..81b17815ed --- /dev/null +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %round_1c7897 "round_1c7897" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%round_1c7897 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 RoundEven %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %round_1c7897 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %round_1c7897 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %round_1c7897 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl new file mode 100644 index 0000000000..ab42e01365 --- /dev/null +++ b/test/intrinsics/gen/round/1c7897.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn round_1c7897() { + var res : vec3 = round(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_1c7897(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_1c7897(); +} + +[[stage(compute)]] +fn compute_main() { + round_1c7897(); +} diff --git a/test/intrinsics/gen/round/52c84d.wgsl b/test/intrinsics/gen/round/52c84d.wgsl new file mode 100644 index 0000000000..189a1d5721 --- /dev/null +++ b/test/intrinsics/gen/round/52c84d.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn round_52c84d() { + var res: vec2 = round(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_52c84d(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_52c84d(); +} + +[[stage(compute)]] +fn compute_main() { + round_52c84d(); +} diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl new file mode 100644 index 0000000000..948707e5ef --- /dev/null +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void round_52c84d() { + float2 res = round(float2(0.0f, 0.0f)); +} + +void vertex_main() { + round_52c84d(); + return; +} + +void fragment_main() { + round_52c84d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + round_52c84d(); + return; +} + diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.msl b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl new file mode 100644 index 0000000000..8b8b6d68c1 --- /dev/null +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void round_52c84d() { + float2 res = rint(float2()); +} + +vertex void vertex_main() { + round_52c84d(); + return; +} + +fragment void fragment_main() { + round_52c84d(); + return; +} + +kernel void compute_main() { + round_52c84d(); + return; +} + diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm new file mode 100644 index 0000000000..d3a9a9a93c --- /dev/null +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %round_52c84d "round_52c84d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%round_52c84d = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 RoundEven %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %round_52c84d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %round_52c84d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %round_52c84d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl new file mode 100644 index 0000000000..9243a33965 --- /dev/null +++ b/test/intrinsics/gen/round/52c84d.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn round_52c84d() { + var res : vec2 = round(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + round_52c84d(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_52c84d(); +} + +[[stage(compute)]] +fn compute_main() { + round_52c84d(); +} diff --git a/test/intrinsics/gen/round/9edc38.wgsl b/test/intrinsics/gen/round/9edc38.wgsl new file mode 100644 index 0000000000..549a6b7951 --- /dev/null +++ b/test/intrinsics/gen/round/9edc38.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn round_9edc38() { + var res: f32 = round(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + round_9edc38(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_9edc38(); +} + +[[stage(compute)]] +fn compute_main() { + round_9edc38(); +} diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl new file mode 100644 index 0000000000..1cebde8c3b --- /dev/null +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void round_9edc38() { + float res = round(1.0f); +} + +void vertex_main() { + round_9edc38(); + return; +} + +void fragment_main() { + round_9edc38(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + round_9edc38(); + return; +} + diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.msl b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl new file mode 100644 index 0000000000..bf4f2abd44 --- /dev/null +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void round_9edc38() { + float res = rint(1.0f); +} + +vertex void vertex_main() { + round_9edc38(); + return; +} + +fragment void fragment_main() { + round_9edc38(); + return; +} + +kernel void compute_main() { + round_9edc38(); + return; +} + diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm new file mode 100644 index 0000000000..8d349145f6 --- /dev/null +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %round_9edc38 "round_9edc38" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%round_9edc38 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 RoundEven %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %round_9edc38 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %round_9edc38 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %round_9edc38 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl new file mode 100644 index 0000000000..fcb59dcb2a --- /dev/null +++ b/test/intrinsics/gen/round/9edc38.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn round_9edc38() { + var res : f32 = round(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + round_9edc38(); +} + +[[stage(fragment)]] +fn fragment_main() { + round_9edc38(); +} + +[[stage(compute)]] +fn compute_main() { + round_9edc38(); +} diff --git a/test/intrinsics/gen/select/00b848.wgsl b/test/intrinsics/gen/select/00b848.wgsl new file mode 100644 index 0000000000..61e3913ccd --- /dev/null +++ b/test/intrinsics/gen/select/00b848.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_00b848() { + var res: vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_00b848(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_00b848(); +} + +[[stage(compute)]] +fn compute_main() { + select_00b848(); +} diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl b/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl new file mode 100644 index 0000000000..813c530a7d --- /dev/null +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_00b848() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_00b848(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_00b848(); +} + +[[stage(compute)]] +fn compute_main() { + select_00b848(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.msl b/test/intrinsics/gen/select/00b848.wgsl.expected.msl new file mode 100644 index 0000000000..426deef40f --- /dev/null +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_00b848() { + int2 res = select(int2(), int2(), bool2()); +} + +vertex void vertex_main() { + select_00b848(); + return; +} + +fragment void fragment_main() { + select_00b848(); + return; +} + +kernel void compute_main() { + select_00b848(); + return; +} + diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm b/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm new file mode 100644 index 0000000000..032991f950 --- /dev/null +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_00b848 "select_00b848" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %12 = OpConstantNull %v2int + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %15 = OpConstantNull %v2bool +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float_1 = OpConstant %float 1 +%select_00b848 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %12 + %9 = OpSelect %v2int %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_00b848 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_00b848 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_00b848 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v2int %12 %12 %15 + diff --git a/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl new file mode 100644 index 0000000000..afae377b0f --- /dev/null +++ b/test/intrinsics/gen/select/00b848.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_00b848() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_00b848(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_00b848(); +} + +[[stage(compute)]] +fn compute_main() { + select_00b848(); +} diff --git a/test/intrinsics/gen/select/01e2cd.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl new file mode 100644 index 0000000000..79c24e4020 --- /dev/null +++ b/test/intrinsics/gen/select/01e2cd.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_01e2cd() { + var res: vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_01e2cd(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_01e2cd(); +} + +[[stage(compute)]] +fn compute_main() { + select_01e2cd(); +} diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl new file mode 100644 index 0000000000..a59ac84743 --- /dev/null +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_01e2cd() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_01e2cd(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_01e2cd(); +} + +[[stage(compute)]] +fn compute_main() { + select_01e2cd(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl new file mode 100644 index 0000000000..652bb8be3d --- /dev/null +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_01e2cd() { + int3 res = select(int3(), int3(), bool3()); +} + +vertex void vertex_main() { + select_01e2cd(); + return; +} + +fragment void fragment_main() { + select_01e2cd(); + return; +} + +kernel void compute_main() { + select_01e2cd(); + return; +} + diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm b/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm new file mode 100644 index 0000000000..f0402bc57e --- /dev/null +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_01e2cd "select_01e2cd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %12 = OpConstantNull %v3int + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %15 = OpConstantNull %v3bool +%_ptr_Function_v3int = OpTypePointer Function %v3int + %float_1 = OpConstant %float 1 +%select_01e2cd = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3int Function %12 + %9 = OpSelect %v3int %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_01e2cd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_01e2cd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_01e2cd + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v3int %12 %12 %15 + diff --git a/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl new file mode 100644 index 0000000000..8cc641b026 --- /dev/null +++ b/test/intrinsics/gen/select/01e2cd.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_01e2cd() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_01e2cd(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_01e2cd(); +} + +[[stage(compute)]] +fn compute_main() { + select_01e2cd(); +} diff --git a/test/intrinsics/gen/select/1e960b.wgsl b/test/intrinsics/gen/select/1e960b.wgsl new file mode 100644 index 0000000000..94fc946d41 --- /dev/null +++ b/test/intrinsics/gen/select/1e960b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_1e960b() { + var res: vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_1e960b(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_1e960b(); +} + +[[stage(compute)]] +fn compute_main() { + select_1e960b(); +} diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl new file mode 100644 index 0000000000..2ad2b344de --- /dev/null +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_1e960b() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_1e960b(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_1e960b(); +} + +[[stage(compute)]] +fn compute_main() { + select_1e960b(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.msl b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl new file mode 100644 index 0000000000..7b9cc564e7 --- /dev/null +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_1e960b() { + uint2 res = select(uint2(), uint2(), bool2()); +} + +vertex void vertex_main() { + select_1e960b(); + return; +} + +fragment void fragment_main() { + select_1e960b(); + return; +} + +kernel void compute_main() { + select_1e960b(); + return; +} + diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm b/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm new file mode 100644 index 0000000000..2f41bf0dcc --- /dev/null +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_1e960b "select_1e960b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %12 = OpConstantNull %v2uint + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %15 = OpConstantNull %v2bool +%_ptr_Function_v2uint = OpTypePointer Function %v2uint + %float_1 = OpConstant %float 1 +%select_1e960b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2uint Function %12 + %9 = OpSelect %v2uint %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_1e960b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_1e960b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_1e960b + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v2uint %12 %12 %15 + diff --git a/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl new file mode 100644 index 0000000000..bbf9f1cece --- /dev/null +++ b/test/intrinsics/gen/select/1e960b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_1e960b() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_1e960b(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_1e960b(); +} + +[[stage(compute)]] +fn compute_main() { + select_1e960b(); +} diff --git a/test/intrinsics/gen/select/266aff.wgsl b/test/intrinsics/gen/select/266aff.wgsl new file mode 100644 index 0000000000..6ad4aebe1c --- /dev/null +++ b/test/intrinsics/gen/select/266aff.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_266aff() { + var res: vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_266aff(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_266aff(); +} + +[[stage(compute)]] +fn compute_main() { + select_266aff(); +} diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl b/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl new file mode 100644 index 0000000000..7fa28bc4f8 --- /dev/null +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_266aff() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_266aff(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_266aff(); +} + +[[stage(compute)]] +fn compute_main() { + select_266aff(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.msl b/test/intrinsics/gen/select/266aff.wgsl.expected.msl new file mode 100644 index 0000000000..9e2b612aef --- /dev/null +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_266aff() { + float2 res = select(float2(), float2(), bool2()); +} + +vertex void vertex_main() { + select_266aff(); + return; +} + +fragment void fragment_main() { + select_266aff(); + return; +} + +kernel void compute_main() { + select_266aff(); + return; +} + diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm b/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm new file mode 100644 index 0000000000..d68b98f036 --- /dev/null +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_266aff "select_266aff" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %11 = OpConstantNull %v2float + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %14 = OpConstantNull %v2bool +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%select_266aff = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %11 + %9 = OpSelect %v2float %11 %11 %14 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %select_266aff + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_266aff + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %select_266aff + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v2float %11 %11 %14 + diff --git a/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl new file mode 100644 index 0000000000..2b269b7d7e --- /dev/null +++ b/test/intrinsics/gen/select/266aff.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_266aff() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_266aff(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_266aff(); +} + +[[stage(compute)]] +fn compute_main() { + select_266aff(); +} diff --git a/test/intrinsics/gen/select/28a27e.wgsl b/test/intrinsics/gen/select/28a27e.wgsl new file mode 100644 index 0000000000..1eb6bba01a --- /dev/null +++ b/test/intrinsics/gen/select/28a27e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_28a27e() { + var res: vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_28a27e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_28a27e(); +} + +[[stage(compute)]] +fn compute_main() { + select_28a27e(); +} diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl new file mode 100644 index 0000000000..51b8dcb1ad --- /dev/null +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_28a27e() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_28a27e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_28a27e(); +} + +[[stage(compute)]] +fn compute_main() { + select_28a27e(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.msl b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl new file mode 100644 index 0000000000..2e6f617c4b --- /dev/null +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_28a27e() { + uint3 res = select(uint3(), uint3(), bool3()); +} + +vertex void vertex_main() { + select_28a27e(); + return; +} + +fragment void fragment_main() { + select_28a27e(); + return; +} + +kernel void compute_main() { + select_28a27e(); + return; +} + diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm b/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm new file mode 100644 index 0000000000..ccbff5af31 --- /dev/null +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_28a27e "select_28a27e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v3uint = OpTypeVector %uint 3 + %12 = OpConstantNull %v3uint + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %15 = OpConstantNull %v3bool +%_ptr_Function_v3uint = OpTypePointer Function %v3uint + %float_1 = OpConstant %float 1 +%select_28a27e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3uint Function %12 + %9 = OpSelect %v3uint %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_28a27e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_28a27e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_28a27e + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v3uint %12 %12 %15 + diff --git a/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl new file mode 100644 index 0000000000..fc8858f81e --- /dev/null +++ b/test/intrinsics/gen/select/28a27e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_28a27e() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_28a27e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_28a27e(); +} + +[[stage(compute)]] +fn compute_main() { + select_28a27e(); +} diff --git a/test/intrinsics/gen/select/416e14.wgsl b/test/intrinsics/gen/select/416e14.wgsl new file mode 100644 index 0000000000..0dd6b76ca9 --- /dev/null +++ b/test/intrinsics/gen/select/416e14.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_416e14() { + var res: f32 = select(1.0, 1.0, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_416e14(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_416e14(); +} + +[[stage(compute)]] +fn compute_main() { + select_416e14(); +} diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl b/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl new file mode 100644 index 0000000000..f2cabc0d82 --- /dev/null +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_416e14() { + var res : f32 = select(1.0, 1.0, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_416e14(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_416e14(); +} + +[[stage(compute)]] +fn compute_main() { + select_416e14(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.msl b/test/intrinsics/gen/select/416e14.wgsl.expected.msl new file mode 100644 index 0000000000..376f282e36 --- /dev/null +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_416e14() { + float res = select(1.0f, 1.0f, bool()); +} + +vertex void vertex_main() { + select_416e14(); + return; +} + +fragment void fragment_main() { + select_416e14(); + return; +} + +kernel void compute_main() { + select_416e14(); + return; +} + diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm b/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm new file mode 100644 index 0000000000..44079c1d62 --- /dev/null +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_416e14 "select_416e14" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 + %bool = OpTypeBool + %12 = OpConstantNull %bool +%_ptr_Function_float = OpTypePointer Function %float +%select_416e14 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpSelect %float %float_1 %float_1 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %select_416e14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %select_416e14 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_416e14 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %float %float_1 %float_1 %12 + diff --git a/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl new file mode 100644 index 0000000000..d44749cd89 --- /dev/null +++ b/test/intrinsics/gen/select/416e14.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_416e14() { + var res : f32 = select(1.0, 1.0, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_416e14(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_416e14(); +} + +[[stage(compute)]] +fn compute_main() { + select_416e14(); +} diff --git a/test/intrinsics/gen/select/80a9a9.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl new file mode 100644 index 0000000000..089c979d2a --- /dev/null +++ b/test/intrinsics/gen/select/80a9a9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_80a9a9() { + var res: vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_80a9a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_80a9a9(); +} + +[[stage(compute)]] +fn compute_main() { + select_80a9a9(); +} diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl new file mode 100644 index 0000000000..784f9fdd49 --- /dev/null +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_80a9a9() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_80a9a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_80a9a9(); +} + +[[stage(compute)]] +fn compute_main() { + select_80a9a9(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl new file mode 100644 index 0000000000..0263844ad7 --- /dev/null +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_80a9a9() { + bool3 res = select(bool3(), bool3(), bool3()); +} + +vertex void vertex_main() { + select_80a9a9(); + return; +} + +fragment void fragment_main() { + select_80a9a9(); + return; +} + +kernel void compute_main() { + select_80a9a9(); + return; +} + diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm new file mode 100644 index 0000000000..34b464e8ea --- /dev/null +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_80a9a9 "select_80a9a9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %12 = OpConstantNull %v3bool +%_ptr_Function_v3bool = OpTypePointer Function %v3bool + %float_1 = OpConstant %float 1 +%select_80a9a9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3bool Function %12 + %9 = OpSelect %v3bool %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %select_80a9a9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %select_80a9a9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_80a9a9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl new file mode 100644 index 0000000000..52d6efe9cc --- /dev/null +++ b/test/intrinsics/gen/select/80a9a9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_80a9a9() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_80a9a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_80a9a9(); +} + +[[stage(compute)]] +fn compute_main() { + select_80a9a9(); +} diff --git a/test/intrinsics/gen/select/99f883.wgsl b/test/intrinsics/gen/select/99f883.wgsl new file mode 100644 index 0000000000..7c078a0857 --- /dev/null +++ b/test/intrinsics/gen/select/99f883.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_99f883() { + var res: u32 = select(1u, 1u, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_99f883(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_99f883(); +} + +[[stage(compute)]] +fn compute_main() { + select_99f883(); +} diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl b/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl new file mode 100644 index 0000000000..7c30f9a136 --- /dev/null +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_99f883() { + var res : u32 = select(1u, 1u, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_99f883(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_99f883(); +} + +[[stage(compute)]] +fn compute_main() { + select_99f883(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.msl b/test/intrinsics/gen/select/99f883.wgsl.expected.msl new file mode 100644 index 0000000000..8332072f32 --- /dev/null +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_99f883() { + uint res = select(1u, 1u, bool()); +} + +vertex void vertex_main() { + select_99f883(); + return; +} + +fragment void fragment_main() { + select_99f883(); + return; +} + +kernel void compute_main() { + select_99f883(); + return; +} + diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm b/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm new file mode 100644 index 0000000000..9452dff9c5 --- /dev/null +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_99f883 "select_99f883" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 + %bool = OpTypeBool + %13 = OpConstantNull %bool +%_ptr_Function_uint = OpTypePointer Function %uint + %16 = OpConstantNull %uint + %float_1 = OpConstant %float 1 +%select_99f883 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_uint Function %16 + %9 = OpSelect %uint %uint_1 %uint_1 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %select_99f883 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_99f883 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %select_99f883 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %uint %uint_1 %uint_1 %13 + diff --git a/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl new file mode 100644 index 0000000000..6dd41c7799 --- /dev/null +++ b/test/intrinsics/gen/select/99f883.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_99f883() { + var res : u32 = select(1u, 1u, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_99f883(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_99f883(); +} + +[[stage(compute)]] +fn compute_main() { + select_99f883(); +} diff --git a/test/intrinsics/gen/select/a2860e.wgsl b/test/intrinsics/gen/select/a2860e.wgsl new file mode 100644 index 0000000000..1df8bf585c --- /dev/null +++ b/test/intrinsics/gen/select/a2860e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_a2860e() { + var res: vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_a2860e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_a2860e(); +} + +[[stage(compute)]] +fn compute_main() { + select_a2860e(); +} diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl new file mode 100644 index 0000000000..06245b94ac --- /dev/null +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_a2860e() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_a2860e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_a2860e(); +} + +[[stage(compute)]] +fn compute_main() { + select_a2860e(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.msl b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl new file mode 100644 index 0000000000..aacb8cee18 --- /dev/null +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_a2860e() { + int4 res = select(int4(), int4(), bool4()); +} + +vertex void vertex_main() { + select_a2860e(); + return; +} + +fragment void fragment_main() { + select_a2860e(); + return; +} + +kernel void compute_main() { + select_a2860e(); + return; +} + diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm b/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm new file mode 100644 index 0000000000..cdc8be8714 --- /dev/null +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_a2860e "select_a2860e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 + %12 = OpConstantNull %v4int + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %15 = OpConstantNull %v4bool +%_ptr_Function_v4int = OpTypePointer Function %v4int + %float_1 = OpConstant %float 1 +%select_a2860e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %12 + %9 = OpSelect %v4int %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_a2860e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_a2860e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_a2860e + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v4int %12 %12 %15 + diff --git a/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl new file mode 100644 index 0000000000..e7cb1ea80f --- /dev/null +++ b/test/intrinsics/gen/select/a2860e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_a2860e() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_a2860e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_a2860e(); +} + +[[stage(compute)]] +fn compute_main() { + select_a2860e(); +} diff --git a/test/intrinsics/gen/select/bb8aae.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl new file mode 100644 index 0000000000..8806956ff9 --- /dev/null +++ b/test/intrinsics/gen/select/bb8aae.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_bb8aae() { + var res: vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_bb8aae(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_bb8aae(); +} + +[[stage(compute)]] +fn compute_main() { + select_bb8aae(); +} diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl new file mode 100644 index 0000000000..b057c7f2cf --- /dev/null +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_bb8aae() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_bb8aae(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_bb8aae(); +} + +[[stage(compute)]] +fn compute_main() { + select_bb8aae(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl new file mode 100644 index 0000000000..a2418f5627 --- /dev/null +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_bb8aae() { + float4 res = select(float4(), float4(), bool4()); +} + +vertex void vertex_main() { + select_bb8aae(); + return; +} + +fragment void fragment_main() { + select_bb8aae(); + return; +} + +kernel void compute_main() { + select_bb8aae(); + return; +} + diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm b/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm new file mode 100644 index 0000000000..6e2774dfb9 --- /dev/null +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_bb8aae "select_bb8aae" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %11 = OpConstantNull %v4float + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %14 = OpConstantNull %v4bool +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%select_bb8aae = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %11 + %9 = OpSelect %v4float %11 %11 %14 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %select_bb8aae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_bb8aae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %select_bb8aae + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v4float %11 %11 %14 + diff --git a/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl new file mode 100644 index 0000000000..85e05cfc50 --- /dev/null +++ b/test/intrinsics/gen/select/bb8aae.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_bb8aae() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_bb8aae(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_bb8aae(); +} + +[[stage(compute)]] +fn compute_main() { + select_bb8aae(); +} diff --git a/test/intrinsics/gen/select/c31f9e.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl new file mode 100644 index 0000000000..d7218031bb --- /dev/null +++ b/test/intrinsics/gen/select/c31f9e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_c31f9e() { + var res: bool = select(bool(), bool(), bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c31f9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c31f9e(); +} + +[[stage(compute)]] +fn compute_main() { + select_c31f9e(); +} diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl new file mode 100644 index 0000000000..65ab282a04 --- /dev/null +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_c31f9e() { + var res : bool = select(bool(), bool(), bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c31f9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c31f9e(); +} + +[[stage(compute)]] +fn compute_main() { + select_c31f9e(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl new file mode 100644 index 0000000000..6719974b37 --- /dev/null +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_c31f9e() { + bool res = select(bool(), bool(), bool()); +} + +vertex void vertex_main() { + select_c31f9e(); + return; +} + +fragment void fragment_main() { + select_c31f9e(); + return; +} + +kernel void compute_main() { + select_c31f9e(); + return; +} + diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm new file mode 100644 index 0000000000..c0961e98fb --- /dev/null +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 24 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_c31f9e "select_c31f9e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %11 = OpConstantNull %bool +%_ptr_Function_bool = OpTypePointer Function %bool + %float_1 = OpConstant %float 1 +%select_c31f9e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_bool Function %11 + %9 = OpSelect %bool %11 %11 %11 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %17 = OpFunctionCall %void %select_c31f9e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %19 = OpLabel + %20 = OpFunctionCall %void %select_c31f9e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_c31f9e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl new file mode 100644 index 0000000000..7ffd827dc8 --- /dev/null +++ b/test/intrinsics/gen/select/c31f9e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_c31f9e() { + var res : bool = select(bool(), bool(), bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c31f9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c31f9e(); +} + +[[stage(compute)]] +fn compute_main() { + select_c31f9e(); +} diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl new file mode 100644 index 0000000000..254b37b267 --- /dev/null +++ b/test/intrinsics/gen/select/c4a4ef.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_c4a4ef() { + var res: vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c4a4ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c4a4ef(); +} + +[[stage(compute)]] +fn compute_main() { + select_c4a4ef(); +} diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl new file mode 100644 index 0000000000..00ad0615ab --- /dev/null +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_c4a4ef() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c4a4ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c4a4ef(); +} + +[[stage(compute)]] +fn compute_main() { + select_c4a4ef(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl new file mode 100644 index 0000000000..65a42ac5c4 --- /dev/null +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_c4a4ef() { + uint4 res = select(uint4(), uint4(), bool4()); +} + +vertex void vertex_main() { + select_c4a4ef(); + return; +} + +fragment void fragment_main() { + select_c4a4ef(); + return; +} + +kernel void compute_main() { + select_c4a4ef(); + return; +} + diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm new file mode 100644 index 0000000000..6c83621d3d --- /dev/null +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_c4a4ef "select_c4a4ef" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %v4uint = OpTypeVector %uint 4 + %12 = OpConstantNull %v4uint + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %15 = OpConstantNull %v4bool +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %float_1 = OpConstant %float 1 +%select_c4a4ef = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %12 + %9 = OpSelect %v4uint %12 %12 %15 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %select_c4a4ef + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_c4a4ef + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %26 = OpLabel + %27 = OpFunctionCall %void %select_c4a4ef + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v4uint %12 %12 %15 + diff --git a/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl new file mode 100644 index 0000000000..4338ad6bf3 --- /dev/null +++ b/test/intrinsics/gen/select/c4a4ef.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_c4a4ef() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_c4a4ef(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_c4a4ef(); +} + +[[stage(compute)]] +fn compute_main() { + select_c4a4ef(); +} diff --git a/test/intrinsics/gen/select/cb9301.wgsl b/test/intrinsics/gen/select/cb9301.wgsl new file mode 100644 index 0000000000..968cf2c9fc --- /dev/null +++ b/test/intrinsics/gen/select/cb9301.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_cb9301() { + var res: vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_cb9301(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_cb9301(); +} + +[[stage(compute)]] +fn compute_main() { + select_cb9301(); +} diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl new file mode 100644 index 0000000000..3c9013c7de --- /dev/null +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_cb9301() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_cb9301(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_cb9301(); +} + +[[stage(compute)]] +fn compute_main() { + select_cb9301(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.msl b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl new file mode 100644 index 0000000000..ffdbe51c23 --- /dev/null +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_cb9301() { + bool2 res = select(bool2(), bool2(), bool2()); +} + +vertex void vertex_main() { + select_cb9301(); + return; +} + +fragment void fragment_main() { + select_cb9301(); + return; +} + +kernel void compute_main() { + select_cb9301(); + return; +} + diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm new file mode 100644 index 0000000000..cd00a77f37 --- /dev/null +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_cb9301 "select_cb9301" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v2bool = OpTypeVector %bool 2 + %12 = OpConstantNull %v2bool +%_ptr_Function_v2bool = OpTypePointer Function %v2bool + %float_1 = OpConstant %float 1 +%select_cb9301 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2bool Function %12 + %9 = OpSelect %v2bool %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %select_cb9301 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %select_cb9301 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_cb9301 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl new file mode 100644 index 0000000000..5d7c05e8bc --- /dev/null +++ b/test/intrinsics/gen/select/cb9301.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_cb9301() { + var res : vec2 = select(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_cb9301(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_cb9301(); +} + +[[stage(compute)]] +fn compute_main() { + select_cb9301(); +} diff --git a/test/intrinsics/gen/select/e3e028.wgsl b/test/intrinsics/gen/select/e3e028.wgsl new file mode 100644 index 0000000000..9b613b0e48 --- /dev/null +++ b/test/intrinsics/gen/select/e3e028.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_e3e028() { + var res: vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_e3e028(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_e3e028(); +} + +[[stage(compute)]] +fn compute_main() { + select_e3e028(); +} diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl new file mode 100644 index 0000000000..31a4f022e5 --- /dev/null +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_e3e028() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_e3e028(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_e3e028(); +} + +[[stage(compute)]] +fn compute_main() { + select_e3e028(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.msl b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl new file mode 100644 index 0000000000..67d331c05b --- /dev/null +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_e3e028() { + bool4 res = select(bool4(), bool4(), bool4()); +} + +vertex void vertex_main() { + select_e3e028(); + return; +} + +fragment void fragment_main() { + select_e3e028(); + return; +} + +kernel void compute_main() { + select_e3e028(); + return; +} + diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm new file mode 100644 index 0000000000..9a327a15f4 --- /dev/null +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_e3e028 "select_e3e028" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %bool = OpTypeBool + %v4bool = OpTypeVector %bool 4 + %12 = OpConstantNull %v4bool +%_ptr_Function_v4bool = OpTypePointer Function %v4bool + %float_1 = OpConstant %float 1 +%select_e3e028 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4bool Function %12 + %9 = OpSelect %v4bool %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %select_e3e028 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %select_e3e028 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %select_e3e028 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl new file mode 100644 index 0000000000..edf186d655 --- /dev/null +++ b/test/intrinsics/gen/select/e3e028.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_e3e028() { + var res : vec4 = select(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_e3e028(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_e3e028(); +} + +[[stage(compute)]] +fn compute_main() { + select_e3e028(); +} diff --git a/test/intrinsics/gen/select/ebfea2.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl new file mode 100644 index 0000000000..994a42796d --- /dev/null +++ b/test/intrinsics/gen/select/ebfea2.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_ebfea2() { + var res: vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ebfea2(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ebfea2(); +} + +[[stage(compute)]] +fn compute_main() { + select_ebfea2(); +} diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl new file mode 100644 index 0000000000..9889d933f8 --- /dev/null +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_ebfea2() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ebfea2(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ebfea2(); +} + +[[stage(compute)]] +fn compute_main() { + select_ebfea2(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl new file mode 100644 index 0000000000..c1a1253437 --- /dev/null +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_ebfea2() { + float3 res = select(float3(), float3(), bool3()); +} + +vertex void vertex_main() { + select_ebfea2(); + return; +} + +fragment void fragment_main() { + select_ebfea2(); + return; +} + +kernel void compute_main() { + select_ebfea2(); + return; +} + diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm b/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm new file mode 100644 index 0000000000..2f1df033d2 --- /dev/null +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_ebfea2 "select_ebfea2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %11 = OpConstantNull %v3float + %bool = OpTypeBool + %v3bool = OpTypeVector %bool 3 + %14 = OpConstantNull %v3bool +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%select_ebfea2 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %11 + %9 = OpSelect %v3float %11 %11 %14 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %select_ebfea2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_ebfea2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %select_ebfea2 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %v3float %11 %11 %14 + diff --git a/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl new file mode 100644 index 0000000000..15cda7c341 --- /dev/null +++ b/test/intrinsics/gen/select/ebfea2.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_ebfea2() { + var res : vec3 = select(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ebfea2(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ebfea2(); +} + +[[stage(compute)]] +fn compute_main() { + select_ebfea2(); +} diff --git a/test/intrinsics/gen/select/ed8a15.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl new file mode 100644 index 0000000000..7b83f92e2d --- /dev/null +++ b/test/intrinsics/gen/select/ed8a15.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn select_ed8a15() { + var res: i32 = select(1, 1, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ed8a15(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ed8a15(); +} + +[[stage(compute)]] +fn compute_main() { + select_ed8a15(); +} diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl new file mode 100644 index 0000000000..4211acad11 --- /dev/null +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +SKIP: FAILED + + +fn select_ed8a15() { + var res : i32 = select(1, 1, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ed8a15(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ed8a15(); +} + +[[stage(compute)]] +fn compute_main() { + select_ed8a15(); +} + +Failed to generate: error: select not supported in HLSL backend yet diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl new file mode 100644 index 0000000000..18b9b3af99 --- /dev/null +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void select_ed8a15() { + int res = select(1, 1, bool()); +} + +vertex void vertex_main() { + select_ed8a15(); + return; +} + +fragment void fragment_main() { + select_ed8a15(); + return; +} + +kernel void compute_main() { + select_ed8a15(); + return; +} + diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm b/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm new file mode 100644 index 0000000000..23dfca35bb --- /dev/null +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %select_ed8a15 "select_ed8a15" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %bool = OpTypeBool + %13 = OpConstantNull %bool +%_ptr_Function_int = OpTypePointer Function %int + %16 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%select_ed8a15 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_int Function %16 + %9 = OpSelect %int %int_1 %int_1 %13 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %select_ed8a15 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %select_ed8a15 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %select_ed8a15 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected bool scalar or vector type as condition: Select + %9 = OpSelect %int %int_1 %int_1 %13 + diff --git a/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl new file mode 100644 index 0000000000..a569ef0a5e --- /dev/null +++ b/test/intrinsics/gen/select/ed8a15.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn select_ed8a15() { + var res : i32 = select(1, 1, bool()); +} + +[[stage(vertex)]] +fn vertex_main() { + select_ed8a15(); +} + +[[stage(fragment)]] +fn fragment_main() { + select_ed8a15(); +} + +[[stage(compute)]] +fn compute_main() { + select_ed8a15(); +} diff --git a/test/intrinsics/gen/sign/159665.wgsl b/test/intrinsics/gen/sign/159665.wgsl new file mode 100644 index 0000000000..49eb85bf12 --- /dev/null +++ b/test/intrinsics/gen/sign/159665.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sign_159665() { + var res: vec3 = sign(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_159665(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_159665(); +} + +[[stage(compute)]] +fn compute_main() { + sign_159665(); +} diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl new file mode 100644 index 0000000000..822f73c9fa --- /dev/null +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sign_159665() { + float3 res = sign(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sign_159665(); + return; +} + +void fragment_main() { + sign_159665(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sign_159665(); + return; +} + diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.msl b/test/intrinsics/gen/sign/159665.wgsl.expected.msl new file mode 100644 index 0000000000..143c0281bf --- /dev/null +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sign_159665() { + float3 res = sign(float3()); +} + +vertex void vertex_main() { + sign_159665(); + return; +} + +fragment void fragment_main() { + sign_159665(); + return; +} + +kernel void compute_main() { + sign_159665(); + return; +} + diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm new file mode 100644 index 0000000000..a14e870e5d --- /dev/null +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sign_159665 "sign_159665" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%sign_159665 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 FSign %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sign_159665 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sign_159665 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sign_159665 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl new file mode 100644 index 0000000000..2f7b9a9f3a --- /dev/null +++ b/test/intrinsics/gen/sign/159665.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sign_159665() { + var res : vec3 = sign(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_159665(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_159665(); +} + +[[stage(compute)]] +fn compute_main() { + sign_159665(); +} diff --git a/test/intrinsics/gen/sign/b8f634.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl new file mode 100644 index 0000000000..85ed595033 --- /dev/null +++ b/test/intrinsics/gen/sign/b8f634.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sign_b8f634() { + var res: vec4 = sign(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_b8f634(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_b8f634(); +} + +[[stage(compute)]] +fn compute_main() { + sign_b8f634(); +} diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl new file mode 100644 index 0000000000..d8c042889d --- /dev/null +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sign_b8f634() { + float4 res = sign(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sign_b8f634(); + return; +} + +void fragment_main() { + sign_b8f634(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sign_b8f634(); + return; +} + diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl new file mode 100644 index 0000000000..d26088ddd3 --- /dev/null +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sign_b8f634() { + float4 res = sign(float4()); +} + +vertex void vertex_main() { + sign_b8f634(); + return; +} + +fragment void fragment_main() { + sign_b8f634(); + return; +} + +kernel void compute_main() { + sign_b8f634(); + return; +} + diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a2d428e02 --- /dev/null +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sign_b8f634 "sign_b8f634" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%sign_b8f634 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 FSign %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sign_b8f634 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sign_b8f634 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sign_b8f634 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl new file mode 100644 index 0000000000..4e8e484ee5 --- /dev/null +++ b/test/intrinsics/gen/sign/b8f634.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sign_b8f634() { + var res : vec4 = sign(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_b8f634(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_b8f634(); +} + +[[stage(compute)]] +fn compute_main() { + sign_b8f634(); +} diff --git a/test/intrinsics/gen/sign/d065d8.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl new file mode 100644 index 0000000000..75254a8e01 --- /dev/null +++ b/test/intrinsics/gen/sign/d065d8.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sign_d065d8() { + var res: vec2 = sign(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_d065d8(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_d065d8(); +} + +[[stage(compute)]] +fn compute_main() { + sign_d065d8(); +} diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl new file mode 100644 index 0000000000..491b380f8b --- /dev/null +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sign_d065d8() { + float2 res = sign(float2(0.0f, 0.0f)); +} + +void vertex_main() { + sign_d065d8(); + return; +} + +void fragment_main() { + sign_d065d8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sign_d065d8(); + return; +} + diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl new file mode 100644 index 0000000000..abacffbb12 --- /dev/null +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sign_d065d8() { + float2 res = sign(float2()); +} + +vertex void vertex_main() { + sign_d065d8(); + return; +} + +fragment void fragment_main() { + sign_d065d8(); + return; +} + +kernel void compute_main() { + sign_d065d8(); + return; +} + diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm new file mode 100644 index 0000000000..f532736669 --- /dev/null +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sign_d065d8 "sign_d065d8" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%sign_d065d8 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 FSign %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sign_d065d8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sign_d065d8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sign_d065d8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl new file mode 100644 index 0000000000..9079c7fae8 --- /dev/null +++ b/test/intrinsics/gen/sign/d065d8.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sign_d065d8() { + var res : vec2 = sign(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_d065d8(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_d065d8(); +} + +[[stage(compute)]] +fn compute_main() { + sign_d065d8(); +} diff --git a/test/intrinsics/gen/sign/dd790e.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl new file mode 100644 index 0000000000..762bdfe406 --- /dev/null +++ b/test/intrinsics/gen/sign/dd790e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sign_dd790e() { + var res: f32 = sign(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_dd790e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_dd790e(); +} + +[[stage(compute)]] +fn compute_main() { + sign_dd790e(); +} diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl new file mode 100644 index 0000000000..52f319c990 --- /dev/null +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sign_dd790e() { + float res = sign(1.0f); +} + +void vertex_main() { + sign_dd790e(); + return; +} + +void fragment_main() { + sign_dd790e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sign_dd790e(); + return; +} + diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl new file mode 100644 index 0000000000..a4d2552b4c --- /dev/null +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sign_dd790e() { + float res = sign(1.0f); +} + +vertex void vertex_main() { + sign_dd790e(); + return; +} + +fragment void fragment_main() { + sign_dd790e(); + return; +} + +kernel void compute_main() { + sign_dd790e(); + return; +} + diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm new file mode 100644 index 0000000000..5403ccb9db --- /dev/null +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sign_dd790e "sign_dd790e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%sign_dd790e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 FSign %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %sign_dd790e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %sign_dd790e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %sign_dd790e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl new file mode 100644 index 0000000000..4ec9d2351d --- /dev/null +++ b/test/intrinsics/gen/sign/dd790e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sign_dd790e() { + var res : f32 = sign(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sign_dd790e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sign_dd790e(); +} + +[[stage(compute)]] +fn compute_main() { + sign_dd790e(); +} diff --git a/test/intrinsics/gen/sin/01f241.wgsl b/test/intrinsics/gen/sin/01f241.wgsl new file mode 100644 index 0000000000..b53e8b8601 --- /dev/null +++ b/test/intrinsics/gen/sin/01f241.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sin_01f241() { + var res: vec3 = sin(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_01f241(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_01f241(); +} + +[[stage(compute)]] +fn compute_main() { + sin_01f241(); +} diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl new file mode 100644 index 0000000000..05afedd069 --- /dev/null +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sin_01f241() { + float3 res = sin(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sin_01f241(); + return; +} + +void fragment_main() { + sin_01f241(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sin_01f241(); + return; +} + diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.msl b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl new file mode 100644 index 0000000000..22ef88683a --- /dev/null +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sin_01f241() { + float3 res = sin(float3()); +} + +vertex void vertex_main() { + sin_01f241(); + return; +} + +fragment void fragment_main() { + sin_01f241(); + return; +} + +kernel void compute_main() { + sin_01f241(); + return; +} + diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm new file mode 100644 index 0000000000..e03940b1a0 --- /dev/null +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sin_01f241 "sin_01f241" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %sin_01f241 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Sin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sin_01f241 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sin_01f241 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sin_01f241 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl new file mode 100644 index 0000000000..4717bb5f4a --- /dev/null +++ b/test/intrinsics/gen/sin/01f241.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sin_01f241() { + var res : vec3 = sin(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_01f241(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_01f241(); +} + +[[stage(compute)]] +fn compute_main() { + sin_01f241(); +} diff --git a/test/intrinsics/gen/sin/4e3979.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl new file mode 100644 index 0000000000..c0282bc1eb --- /dev/null +++ b/test/intrinsics/gen/sin/4e3979.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sin_4e3979() { + var res: vec4 = sin(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_4e3979(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_4e3979(); +} + +[[stage(compute)]] +fn compute_main() { + sin_4e3979(); +} diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl new file mode 100644 index 0000000000..6ef2c93ec7 --- /dev/null +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sin_4e3979() { + float4 res = sin(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sin_4e3979(); + return; +} + +void fragment_main() { + sin_4e3979(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sin_4e3979(); + return; +} + diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl new file mode 100644 index 0000000000..331a368a67 --- /dev/null +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sin_4e3979() { + float4 res = sin(float4()); +} + +vertex void vertex_main() { + sin_4e3979(); + return; +} + +fragment void fragment_main() { + sin_4e3979(); + return; +} + +kernel void compute_main() { + sin_4e3979(); + return; +} + diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm new file mode 100644 index 0000000000..af59f4a524 --- /dev/null +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sin_4e3979 "sin_4e3979" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %sin_4e3979 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Sin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sin_4e3979 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sin_4e3979 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sin_4e3979 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl new file mode 100644 index 0000000000..ae9d1451a4 --- /dev/null +++ b/test/intrinsics/gen/sin/4e3979.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sin_4e3979() { + var res : vec4 = sin(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_4e3979(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_4e3979(); +} + +[[stage(compute)]] +fn compute_main() { + sin_4e3979(); +} diff --git a/test/intrinsics/gen/sin/b78c91.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl new file mode 100644 index 0000000000..35cd7d9df8 --- /dev/null +++ b/test/intrinsics/gen/sin/b78c91.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sin_b78c91() { + var res: f32 = sin(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_b78c91(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_b78c91(); +} + +[[stage(compute)]] +fn compute_main() { + sin_b78c91(); +} diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl new file mode 100644 index 0000000000..e3c066a1cc --- /dev/null +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sin_b78c91() { + float res = sin(1.0f); +} + +void vertex_main() { + sin_b78c91(); + return; +} + +void fragment_main() { + sin_b78c91(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sin_b78c91(); + return; +} + diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl new file mode 100644 index 0000000000..ddada4c38e --- /dev/null +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sin_b78c91() { + float res = sin(1.0f); +} + +vertex void vertex_main() { + sin_b78c91(); + return; +} + +fragment void fragment_main() { + sin_b78c91(); + return; +} + +kernel void compute_main() { + sin_b78c91(); + return; +} + diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm new file mode 100644 index 0000000000..b1ba48dc71 --- /dev/null +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sin_b78c91 "sin_b78c91" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %sin_b78c91 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Sin %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %sin_b78c91 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %sin_b78c91 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %sin_b78c91 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl new file mode 100644 index 0000000000..de3a1f3546 --- /dev/null +++ b/test/intrinsics/gen/sin/b78c91.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sin_b78c91() { + var res : f32 = sin(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_b78c91(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_b78c91(); +} + +[[stage(compute)]] +fn compute_main() { + sin_b78c91(); +} diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl new file mode 100644 index 0000000000..ea5e900cdf --- /dev/null +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sin_fc8bc4() { + var res: vec2 = sin(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_fc8bc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_fc8bc4(); +} + +[[stage(compute)]] +fn compute_main() { + sin_fc8bc4(); +} diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl new file mode 100644 index 0000000000..e24e20e027 --- /dev/null +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sin_fc8bc4() { + float2 res = sin(float2(0.0f, 0.0f)); +} + +void vertex_main() { + sin_fc8bc4(); + return; +} + +void fragment_main() { + sin_fc8bc4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sin_fc8bc4(); + return; +} + diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl new file mode 100644 index 0000000000..0dbeea856d --- /dev/null +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sin_fc8bc4() { + float2 res = sin(float2()); +} + +vertex void vertex_main() { + sin_fc8bc4(); + return; +} + +fragment void fragment_main() { + sin_fc8bc4(); + return; +} + +kernel void compute_main() { + sin_fc8bc4(); + return; +} + diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm new file mode 100644 index 0000000000..d9a58ad8f7 --- /dev/null +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sin_fc8bc4 "sin_fc8bc4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %sin_fc8bc4 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Sin %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sin_fc8bc4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sin_fc8bc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sin_fc8bc4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl new file mode 100644 index 0000000000..35ad28e84e --- /dev/null +++ b/test/intrinsics/gen/sin/fc8bc4.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sin_fc8bc4() { + var res : vec2 = sin(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sin_fc8bc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + sin_fc8bc4(); +} + +[[stage(compute)]] +fn compute_main() { + sin_fc8bc4(); +} diff --git a/test/intrinsics/gen/sinh/445e33.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl new file mode 100644 index 0000000000..0a62c8184d --- /dev/null +++ b/test/intrinsics/gen/sinh/445e33.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sinh_445e33() { + var res: vec4 = sinh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_445e33(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_445e33(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_445e33(); +} diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl new file mode 100644 index 0000000000..b8cb85b7e4 --- /dev/null +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sinh_445e33() { + float4 res = sinh(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sinh_445e33(); + return; +} + +void fragment_main() { + sinh_445e33(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sinh_445e33(); + return; +} + diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl new file mode 100644 index 0000000000..0f8947154d --- /dev/null +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sinh_445e33() { + float4 res = sinh(float4()); +} + +vertex void vertex_main() { + sinh_445e33(); + return; +} + +fragment void fragment_main() { + sinh_445e33(); + return; +} + +kernel void compute_main() { + sinh_445e33(); + return; +} + diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm new file mode 100644 index 0000000000..734a54bdbf --- /dev/null +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sinh_445e33 "sinh_445e33" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%sinh_445e33 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Sinh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sinh_445e33 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sinh_445e33 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sinh_445e33 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl new file mode 100644 index 0000000000..ad790a5b28 --- /dev/null +++ b/test/intrinsics/gen/sinh/445e33.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sinh_445e33() { + var res : vec4 = sinh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_445e33(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_445e33(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_445e33(); +} diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl new file mode 100644 index 0000000000..b38208c46e --- /dev/null +++ b/test/intrinsics/gen/sinh/7bb598.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sinh_7bb598() { + var res: f32 = sinh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_7bb598(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_7bb598(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_7bb598(); +} diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl new file mode 100644 index 0000000000..181c064146 --- /dev/null +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sinh_7bb598() { + float res = sinh(1.0f); +} + +void vertex_main() { + sinh_7bb598(); + return; +} + +void fragment_main() { + sinh_7bb598(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sinh_7bb598(); + return; +} + diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl new file mode 100644 index 0000000000..d14c1fbc6f --- /dev/null +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sinh_7bb598() { + float res = sinh(1.0f); +} + +vertex void vertex_main() { + sinh_7bb598(); + return; +} + +fragment void fragment_main() { + sinh_7bb598(); + return; +} + +kernel void compute_main() { + sinh_7bb598(); + return; +} + diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm new file mode 100644 index 0000000000..481720dd99 --- /dev/null +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sinh_7bb598 "sinh_7bb598" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%sinh_7bb598 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Sinh %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %sinh_7bb598 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %sinh_7bb598 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %sinh_7bb598 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl new file mode 100644 index 0000000000..ae2a45f406 --- /dev/null +++ b/test/intrinsics/gen/sinh/7bb598.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sinh_7bb598() { + var res : f32 = sinh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_7bb598(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_7bb598(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_7bb598(); +} diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl new file mode 100644 index 0000000000..5f596f2431 --- /dev/null +++ b/test/intrinsics/gen/sinh/b9860e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sinh_b9860e() { + var res: vec2 = sinh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_b9860e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_b9860e(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_b9860e(); +} diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl new file mode 100644 index 0000000000..4c2cd68e6c --- /dev/null +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sinh_b9860e() { + float2 res = sinh(float2(0.0f, 0.0f)); +} + +void vertex_main() { + sinh_b9860e(); + return; +} + +void fragment_main() { + sinh_b9860e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sinh_b9860e(); + return; +} + diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl new file mode 100644 index 0000000000..3f6dc50b8b --- /dev/null +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sinh_b9860e() { + float2 res = sinh(float2()); +} + +vertex void vertex_main() { + sinh_b9860e(); + return; +} + +fragment void fragment_main() { + sinh_b9860e(); + return; +} + +kernel void compute_main() { + sinh_b9860e(); + return; +} + diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm new file mode 100644 index 0000000000..82b4486a1e --- /dev/null +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sinh_b9860e "sinh_b9860e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%sinh_b9860e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Sinh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sinh_b9860e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sinh_b9860e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sinh_b9860e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl new file mode 100644 index 0000000000..20bc6e3f8f --- /dev/null +++ b/test/intrinsics/gen/sinh/b9860e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sinh_b9860e() { + var res : vec2 = sinh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_b9860e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_b9860e(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_b9860e(); +} diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl new file mode 100644 index 0000000000..0f60e63b32 --- /dev/null +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sinh_c9a5eb() { + var res: vec3 = sinh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_c9a5eb(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_c9a5eb(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_c9a5eb(); +} diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl new file mode 100644 index 0000000000..b18f22ecd4 --- /dev/null +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sinh_c9a5eb() { + float3 res = sinh(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sinh_c9a5eb(); + return; +} + +void fragment_main() { + sinh_c9a5eb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sinh_c9a5eb(); + return; +} + diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl new file mode 100644 index 0000000000..91ba6f6657 --- /dev/null +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sinh_c9a5eb() { + float3 res = sinh(float3()); +} + +vertex void vertex_main() { + sinh_c9a5eb(); + return; +} + +fragment void fragment_main() { + sinh_c9a5eb(); + return; +} + +kernel void compute_main() { + sinh_c9a5eb(); + return; +} + diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm new file mode 100644 index 0000000000..480ba1c16e --- /dev/null +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sinh_c9a5eb "sinh_c9a5eb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%sinh_c9a5eb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Sinh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sinh_c9a5eb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sinh_c9a5eb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sinh_c9a5eb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl new file mode 100644 index 0000000000..7056b19854 --- /dev/null +++ b/test/intrinsics/gen/sinh/c9a5eb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sinh_c9a5eb() { + var res : vec3 = sinh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sinh_c9a5eb(); +} + +[[stage(fragment)]] +fn fragment_main() { + sinh_c9a5eb(); +} + +[[stage(compute)]] +fn compute_main() { + sinh_c9a5eb(); +} diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl new file mode 100644 index 0000000000..c71fcf0f69 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn smoothStep_5f615b() { + var res: vec4 = smoothStep(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_5f615b(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_5f615b(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_5f615b(); +} diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl new file mode 100644 index 0000000000..49c6c6129d --- /dev/null +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void smoothStep_5f615b() { + float4 res = smoothstep(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + smoothStep_5f615b(); + return; +} + +void fragment_main() { + smoothStep_5f615b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + smoothStep_5f615b(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl new file mode 100644 index 0000000000..3f21ed34b9 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void smoothStep_5f615b() { + float4 res = smoothstep(float4(), float4(), float4()); +} + +vertex void vertex_main() { + smoothStep_5f615b(); + return; +} + +fragment void fragment_main() { + smoothStep_5f615b(); + return; +} + +kernel void compute_main() { + smoothStep_5f615b(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm new file mode 100644 index 0000000000..f2e61127c2 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %smoothStep_5f615b "smoothStep_5f615b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%smoothStep_5f615b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 SmoothStep %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %smoothStep_5f615b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %smoothStep_5f615b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %smoothStep_5f615b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl new file mode 100644 index 0000000000..26e95e4bd9 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/5f615b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn smoothStep_5f615b() { + var res : vec4 = smoothStep(vec4(), vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_5f615b(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_5f615b(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_5f615b(); +} diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl new file mode 100644 index 0000000000..c66c45f8db --- /dev/null +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn smoothStep_658be3() { + var res: vec3 = smoothStep(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_658be3(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_658be3(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_658be3(); +} diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl new file mode 100644 index 0000000000..80b9c8162f --- /dev/null +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void smoothStep_658be3() { + float3 res = smoothstep(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + smoothStep_658be3(); + return; +} + +void fragment_main() { + smoothStep_658be3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + smoothStep_658be3(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl new file mode 100644 index 0000000000..dc7e7a4dd8 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void smoothStep_658be3() { + float3 res = smoothstep(float3(), float3(), float3()); +} + +vertex void vertex_main() { + smoothStep_658be3(); + return; +} + +fragment void fragment_main() { + smoothStep_658be3(); + return; +} + +kernel void compute_main() { + smoothStep_658be3(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm new file mode 100644 index 0000000000..82787971ac --- /dev/null +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %smoothStep_658be3 "smoothStep_658be3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%smoothStep_658be3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 SmoothStep %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %smoothStep_658be3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %smoothStep_658be3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %smoothStep_658be3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl new file mode 100644 index 0000000000..5a6bd897ef --- /dev/null +++ b/test/intrinsics/gen/smoothStep/658be3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn smoothStep_658be3() { + var res : vec3 = smoothStep(vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_658be3(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_658be3(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_658be3(); +} diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl new file mode 100644 index 0000000000..1f531a23fe --- /dev/null +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn smoothStep_c11eef() { + var res: vec2 = smoothStep(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_c11eef(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_c11eef(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_c11eef(); +} diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl new file mode 100644 index 0000000000..bda91514ed --- /dev/null +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void smoothStep_c11eef() { + float2 res = smoothstep(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + smoothStep_c11eef(); + return; +} + +void fragment_main() { + smoothStep_c11eef(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + smoothStep_c11eef(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl new file mode 100644 index 0000000000..3f3315dbe1 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void smoothStep_c11eef() { + float2 res = smoothstep(float2(), float2(), float2()); +} + +vertex void vertex_main() { + smoothStep_c11eef(); + return; +} + +fragment void fragment_main() { + smoothStep_c11eef(); + return; +} + +kernel void compute_main() { + smoothStep_c11eef(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm new file mode 100644 index 0000000000..4d21a966ca --- /dev/null +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %smoothStep_c11eef "smoothStep_c11eef" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%smoothStep_c11eef = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 SmoothStep %12 %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %smoothStep_c11eef + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %smoothStep_c11eef + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %smoothStep_c11eef + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl new file mode 100644 index 0000000000..147b9fdb45 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/c11eef.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn smoothStep_c11eef() { + var res : vec2 = smoothStep(vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_c11eef(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_c11eef(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_c11eef(); +} diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl new file mode 100644 index 0000000000..e67b070f19 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn smoothStep_cb0bfb() { + var res: f32 = smoothStep(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_cb0bfb(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_cb0bfb(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_cb0bfb(); +} diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl new file mode 100644 index 0000000000..7f9a93da6c --- /dev/null +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void smoothStep_cb0bfb() { + float res = smoothstep(1.0f, 1.0f, 1.0f); +} + +void vertex_main() { + smoothStep_cb0bfb(); + return; +} + +void fragment_main() { + smoothStep_cb0bfb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + smoothStep_cb0bfb(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl new file mode 100644 index 0000000000..9e0b99ad53 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void smoothStep_cb0bfb() { + float res = smoothstep(1.0f, 1.0f, 1.0f); +} + +vertex void vertex_main() { + smoothStep_cb0bfb(); + return; +} + +fragment void fragment_main() { + smoothStep_cb0bfb(); + return; +} + +kernel void compute_main() { + smoothStep_cb0bfb(); + return; +} + diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm new file mode 100644 index 0000000000..e991a8ce08 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %smoothStep_cb0bfb "smoothStep_cb0bfb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%smoothStep_cb0bfb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 SmoothStep %float_1 %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %smoothStep_cb0bfb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %smoothStep_cb0bfb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %smoothStep_cb0bfb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl new file mode 100644 index 0000000000..7ecfe0cda3 --- /dev/null +++ b/test/intrinsics/gen/smoothStep/cb0bfb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn smoothStep_cb0bfb() { + var res : f32 = smoothStep(1.0, 1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + smoothStep_cb0bfb(); +} + +[[stage(fragment)]] +fn fragment_main() { + smoothStep_cb0bfb(); +} + +[[stage(compute)]] +fn compute_main() { + smoothStep_cb0bfb(); +} diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl new file mode 100644 index 0000000000..7a74f526bc --- /dev/null +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sqrt_20c74e() { + var res: f32 = sqrt(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_20c74e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_20c74e(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_20c74e(); +} diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl new file mode 100644 index 0000000000..d9fdd428f8 --- /dev/null +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sqrt_20c74e() { + float res = sqrt(1.0f); +} + +void vertex_main() { + sqrt_20c74e(); + return; +} + +void fragment_main() { + sqrt_20c74e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sqrt_20c74e(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl new file mode 100644 index 0000000000..591cff9fd1 --- /dev/null +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sqrt_20c74e() { + float res = sqrt(1.0f); +} + +vertex void vertex_main() { + sqrt_20c74e(); + return; +} + +fragment void fragment_main() { + sqrt_20c74e(); + return; +} + +kernel void compute_main() { + sqrt_20c74e(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm new file mode 100644 index 0000000000..fefbb94e00 --- /dev/null +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sqrt_20c74e "sqrt_20c74e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%sqrt_20c74e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Sqrt %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %sqrt_20c74e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %sqrt_20c74e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %sqrt_20c74e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl new file mode 100644 index 0000000000..4aeac6494c --- /dev/null +++ b/test/intrinsics/gen/sqrt/20c74e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sqrt_20c74e() { + var res : f32 = sqrt(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_20c74e(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_20c74e(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_20c74e(); +} diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl new file mode 100644 index 0000000000..9286ae37db --- /dev/null +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sqrt_8c7024() { + var res: vec2 = sqrt(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_8c7024(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_8c7024(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_8c7024(); +} diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl new file mode 100644 index 0000000000..2e82392d9e --- /dev/null +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sqrt_8c7024() { + float2 res = sqrt(float2(0.0f, 0.0f)); +} + +void vertex_main() { + sqrt_8c7024(); + return; +} + +void fragment_main() { + sqrt_8c7024(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sqrt_8c7024(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl new file mode 100644 index 0000000000..b2852fffbe --- /dev/null +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sqrt_8c7024() { + float2 res = sqrt(float2()); +} + +vertex void vertex_main() { + sqrt_8c7024(); + return; +} + +fragment void fragment_main() { + sqrt_8c7024(); + return; +} + +kernel void compute_main() { + sqrt_8c7024(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm new file mode 100644 index 0000000000..ba243fcc71 --- /dev/null +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sqrt_8c7024 "sqrt_8c7024" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%sqrt_8c7024 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Sqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sqrt_8c7024 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sqrt_8c7024 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sqrt_8c7024 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl new file mode 100644 index 0000000000..6b97f1eabd --- /dev/null +++ b/test/intrinsics/gen/sqrt/8c7024.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sqrt_8c7024() { + var res : vec2 = sqrt(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_8c7024(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_8c7024(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_8c7024(); +} diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl new file mode 100644 index 0000000000..d559779cde --- /dev/null +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sqrt_aa0d7a() { + var res: vec4 = sqrt(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_aa0d7a(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_aa0d7a(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_aa0d7a(); +} diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl new file mode 100644 index 0000000000..bc2186738f --- /dev/null +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sqrt_aa0d7a() { + float4 res = sqrt(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sqrt_aa0d7a(); + return; +} + +void fragment_main() { + sqrt_aa0d7a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sqrt_aa0d7a(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl new file mode 100644 index 0000000000..9dbff0ed15 --- /dev/null +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sqrt_aa0d7a() { + float4 res = sqrt(float4()); +} + +vertex void vertex_main() { + sqrt_aa0d7a(); + return; +} + +fragment void fragment_main() { + sqrt_aa0d7a(); + return; +} + +kernel void compute_main() { + sqrt_aa0d7a(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm new file mode 100644 index 0000000000..0a422cc749 --- /dev/null +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sqrt_aa0d7a "sqrt_aa0d7a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%sqrt_aa0d7a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Sqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sqrt_aa0d7a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sqrt_aa0d7a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sqrt_aa0d7a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl new file mode 100644 index 0000000000..378567474f --- /dev/null +++ b/test/intrinsics/gen/sqrt/aa0d7a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sqrt_aa0d7a() { + var res : vec4 = sqrt(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_aa0d7a(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_aa0d7a(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_aa0d7a(); +} diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl new file mode 100644 index 0000000000..ab11967e7d --- /dev/null +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn sqrt_f8c59a() { + var res: vec3 = sqrt(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_f8c59a(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_f8c59a(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_f8c59a(); +} diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl new file mode 100644 index 0000000000..1dd2bc3378 --- /dev/null +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void sqrt_f8c59a() { + float3 res = sqrt(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + sqrt_f8c59a(); + return; +} + +void fragment_main() { + sqrt_f8c59a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + sqrt_f8c59a(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl new file mode 100644 index 0000000000..9cb74e639b --- /dev/null +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void sqrt_f8c59a() { + float3 res = sqrt(float3()); +} + +vertex void vertex_main() { + sqrt_f8c59a(); + return; +} + +fragment void fragment_main() { + sqrt_f8c59a(); + return; +} + +kernel void compute_main() { + sqrt_f8c59a(); + return; +} + diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm new file mode 100644 index 0000000000..c29897ac0e --- /dev/null +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %sqrt_f8c59a "sqrt_f8c59a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%sqrt_f8c59a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Sqrt %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %sqrt_f8c59a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %sqrt_f8c59a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %sqrt_f8c59a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl new file mode 100644 index 0000000000..3a3adbe243 --- /dev/null +++ b/test/intrinsics/gen/sqrt/f8c59a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn sqrt_f8c59a() { + var res : vec3 = sqrt(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + sqrt_f8c59a(); +} + +[[stage(fragment)]] +fn fragment_main() { + sqrt_f8c59a(); +} + +[[stage(compute)]] +fn compute_main() { + sqrt_f8c59a(); +} diff --git a/test/intrinsics/gen/step/0b073b.wgsl b/test/intrinsics/gen/step/0b073b.wgsl new file mode 100644 index 0000000000..8efda6061d --- /dev/null +++ b/test/intrinsics/gen/step/0b073b.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn step_0b073b() { + var res: f32 = step(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + step_0b073b(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_0b073b(); +} + +[[stage(compute)]] +fn compute_main() { + step_0b073b(); +} diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl new file mode 100644 index 0000000000..4aa8a03b71 --- /dev/null +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void step_0b073b() { + float res = step(1.0f, 1.0f); +} + +void vertex_main() { + step_0b073b(); + return; +} + +void fragment_main() { + step_0b073b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + step_0b073b(); + return; +} + diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.msl b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl new file mode 100644 index 0000000000..379623df1b --- /dev/null +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void step_0b073b() { + float res = step(1.0f, 1.0f); +} + +vertex void vertex_main() { + step_0b073b(); + return; +} + +fragment void fragment_main() { + step_0b073b(); + return; +} + +kernel void compute_main() { + step_0b073b(); + return; +} + diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm new file mode 100644 index 0000000000..733e788b3b --- /dev/null +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %step_0b073b "step_0b073b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%step_0b073b = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Step %float_1 %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %step_0b073b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %step_0b073b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %step_0b073b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl new file mode 100644 index 0000000000..c75b485013 --- /dev/null +++ b/test/intrinsics/gen/step/0b073b.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn step_0b073b() { + var res : f32 = step(1.0, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + step_0b073b(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_0b073b(); +} + +[[stage(compute)]] +fn compute_main() { + step_0b073b(); +} diff --git a/test/intrinsics/gen/step/19accd.wgsl b/test/intrinsics/gen/step/19accd.wgsl new file mode 100644 index 0000000000..faebe4e6b6 --- /dev/null +++ b/test/intrinsics/gen/step/19accd.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn step_19accd() { + var res: vec2 = step(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_19accd(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_19accd(); +} + +[[stage(compute)]] +fn compute_main() { + step_19accd(); +} diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl new file mode 100644 index 0000000000..7dd620568d --- /dev/null +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void step_19accd() { + float2 res = step(float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + step_19accd(); + return; +} + +void fragment_main() { + step_19accd(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + step_19accd(); + return; +} + diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.msl b/test/intrinsics/gen/step/19accd.wgsl.expected.msl new file mode 100644 index 0000000000..781b56a1a7 --- /dev/null +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void step_19accd() { + float2 res = step(float2(), float2()); +} + +vertex void vertex_main() { + step_19accd(); + return; +} + +fragment void fragment_main() { + step_19accd(); + return; +} + +kernel void compute_main() { + step_19accd(); + return; +} + diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm new file mode 100644 index 0000000000..93706b09b9 --- /dev/null +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %step_19accd "step_19accd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%step_19accd = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Step %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %step_19accd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %step_19accd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %step_19accd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl new file mode 100644 index 0000000000..e45f4ee53f --- /dev/null +++ b/test/intrinsics/gen/step/19accd.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn step_19accd() { + var res : vec2 = step(vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_19accd(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_19accd(); +} + +[[stage(compute)]] +fn compute_main() { + step_19accd(); +} diff --git a/test/intrinsics/gen/step/334303.wgsl b/test/intrinsics/gen/step/334303.wgsl new file mode 100644 index 0000000000..e6923573ed --- /dev/null +++ b/test/intrinsics/gen/step/334303.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn step_334303() { + var res: vec3 = step(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_334303(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_334303(); +} + +[[stage(compute)]] +fn compute_main() { + step_334303(); +} diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.hlsl b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl new file mode 100644 index 0000000000..ee296d273f --- /dev/null +++ b/test/intrinsics/gen/step/334303.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void step_334303() { + float3 res = step(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + step_334303(); + return; +} + +void fragment_main() { + step_334303(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + step_334303(); + return; +} + diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.msl b/test/intrinsics/gen/step/334303.wgsl.expected.msl new file mode 100644 index 0000000000..cc538963d9 --- /dev/null +++ b/test/intrinsics/gen/step/334303.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void step_334303() { + float3 res = step(float3(), float3()); +} + +vertex void vertex_main() { + step_334303(); + return; +} + +fragment void fragment_main() { + step_334303(); + return; +} + +kernel void compute_main() { + step_334303(); + return; +} + diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.spvasm b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm new file mode 100644 index 0000000000..6d91105d57 --- /dev/null +++ b/test/intrinsics/gen/step/334303.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %step_334303 "step_334303" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%step_334303 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Step %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %step_334303 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %step_334303 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %step_334303 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/step/334303.wgsl.expected.wgsl b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl new file mode 100644 index 0000000000..d14ad043e9 --- /dev/null +++ b/test/intrinsics/gen/step/334303.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn step_334303() { + var res : vec3 = step(vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_334303(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_334303(); +} + +[[stage(compute)]] +fn compute_main() { + step_334303(); +} diff --git a/test/intrinsics/gen/step/e2b337.wgsl b/test/intrinsics/gen/step/e2b337.wgsl new file mode 100644 index 0000000000..8e11a80f39 --- /dev/null +++ b/test/intrinsics/gen/step/e2b337.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn step_e2b337() { + var res: vec4 = step(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_e2b337(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_e2b337(); +} + +[[stage(compute)]] +fn compute_main() { + step_e2b337(); +} diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl new file mode 100644 index 0000000000..27f9644603 --- /dev/null +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void step_e2b337() { + float4 res = step(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + step_e2b337(); + return; +} + +void fragment_main() { + step_e2b337(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + step_e2b337(); + return; +} + diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.msl b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl new file mode 100644 index 0000000000..a59fbfe3c6 --- /dev/null +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void step_e2b337() { + float4 res = step(float4(), float4()); +} + +vertex void vertex_main() { + step_e2b337(); + return; +} + +fragment void fragment_main() { + step_e2b337(); + return; +} + +kernel void compute_main() { + step_e2b337(); + return; +} + diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm new file mode 100644 index 0000000000..5221bea09c --- /dev/null +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %step_e2b337 "step_e2b337" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%step_e2b337 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Step %12 %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %step_e2b337 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %step_e2b337 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %step_e2b337 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl new file mode 100644 index 0000000000..2309dbf1a5 --- /dev/null +++ b/test/intrinsics/gen/step/e2b337.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn step_e2b337() { + var res : vec4 = step(vec4(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + step_e2b337(); +} + +[[stage(fragment)]] +fn fragment_main() { + step_e2b337(); +} + +[[stage(compute)]] +fn compute_main() { + step_e2b337(); +} diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl new file mode 100644 index 0000000000..90112554d9 --- /dev/null +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn storageBarrier_d87211() { + storageBarrier(); +} + +[[stage(compute)]] +fn compute_main() { + storageBarrier_d87211(); +} diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl new file mode 100644 index 0000000000..1f80dfce8d --- /dev/null +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.hlsl @@ -0,0 +1,10 @@ +void storageBarrier_d87211() { + DeviceMemoryBarrierWithGroupSync(); +} + +[numthreads(1, 1, 1)] +void compute_main() { + storageBarrier_d87211(); + return; +} + diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl new file mode 100644 index 0000000000..daafd40a2b --- /dev/null +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void storageBarrier_d87211() { + threadgroup_barrier(mem_flags::mem_device); +} + +kernel void compute_main() { + storageBarrier_d87211(); + return; +} + diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm new file mode 100644 index 0000000000..f8fa6e97d7 --- /dev/null +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.spvasm @@ -0,0 +1,27 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 13 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %storageBarrier_d87211 "storageBarrier_d87211" + OpName %compute_main "compute_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 + %uint_1 = OpConstant %uint 1 + %uint_72 = OpConstant %uint 72 +%storageBarrier_d87211 = OpFunction %void None %1 + %4 = OpLabel + OpControlBarrier %uint_2 %uint_1 %uint_72 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %1 + %11 = OpLabel + %12 = OpFunctionCall %void %storageBarrier_d87211 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl new file mode 100644 index 0000000000..9ca8e844c1 --- /dev/null +++ b/test/intrinsics/gen/storageBarrier/d87211.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn storageBarrier_d87211() { + storageBarrier(); +} + +[[stage(compute)]] +fn compute_main() { + storageBarrier_d87211(); +} diff --git a/test/intrinsics/gen/tan/244e2a.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl new file mode 100644 index 0000000000..7bb14bfe9f --- /dev/null +++ b/test/intrinsics/gen/tan/244e2a.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tan_244e2a() { + var res: vec4 = tan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_244e2a(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_244e2a(); +} + +[[stage(compute)]] +fn compute_main() { + tan_244e2a(); +} diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl new file mode 100644 index 0000000000..5044adde2e --- /dev/null +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tan_244e2a() { + float4 res = tan(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + tan_244e2a(); + return; +} + +void fragment_main() { + tan_244e2a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tan_244e2a(); + return; +} + diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl new file mode 100644 index 0000000000..1f3a31df28 --- /dev/null +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tan_244e2a() { + float4 res = tan(float4()); +} + +vertex void vertex_main() { + tan_244e2a(); + return; +} + +fragment void fragment_main() { + tan_244e2a(); + return; +} + +kernel void compute_main() { + tan_244e2a(); + return; +} + diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm new file mode 100644 index 0000000000..4ad27293ce --- /dev/null +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tan_244e2a "tan_244e2a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 + %tan_244e2a = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Tan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tan_244e2a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tan_244e2a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tan_244e2a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl new file mode 100644 index 0000000000..56c1b2ddbd --- /dev/null +++ b/test/intrinsics/gen/tan/244e2a.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tan_244e2a() { + var res : vec4 = tan(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_244e2a(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_244e2a(); +} + +[[stage(compute)]] +fn compute_main() { + tan_244e2a(); +} diff --git a/test/intrinsics/gen/tan/2f030e.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl new file mode 100644 index 0000000000..f0e42585bd --- /dev/null +++ b/test/intrinsics/gen/tan/2f030e.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tan_2f030e() { + var res: f32 = tan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_2f030e(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_2f030e(); +} + +[[stage(compute)]] +fn compute_main() { + tan_2f030e(); +} diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl new file mode 100644 index 0000000000..b647df266e --- /dev/null +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tan_2f030e() { + float res = tan(1.0f); +} + +void vertex_main() { + tan_2f030e(); + return; +} + +void fragment_main() { + tan_2f030e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tan_2f030e(); + return; +} + diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl new file mode 100644 index 0000000000..19a8b8fd07 --- /dev/null +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tan_2f030e() { + float res = tan(1.0f); +} + +vertex void vertex_main() { + tan_2f030e(); + return; +} + +fragment void fragment_main() { + tan_2f030e(); + return; +} + +kernel void compute_main() { + tan_2f030e(); + return; +} + diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm new file mode 100644 index 0000000000..ba5b2cede1 --- /dev/null +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tan_2f030e "tan_2f030e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float + %tan_2f030e = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Tan %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %tan_2f030e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %tan_2f030e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %tan_2f030e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl new file mode 100644 index 0000000000..da88b0db80 --- /dev/null +++ b/test/intrinsics/gen/tan/2f030e.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tan_2f030e() { + var res : f32 = tan(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_2f030e(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_2f030e(); +} + +[[stage(compute)]] +fn compute_main() { + tan_2f030e(); +} diff --git a/test/intrinsics/gen/tan/7ea104.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl new file mode 100644 index 0000000000..c01ac629e9 --- /dev/null +++ b/test/intrinsics/gen/tan/7ea104.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tan_7ea104() { + var res: vec3 = tan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_7ea104(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_7ea104(); +} + +[[stage(compute)]] +fn compute_main() { + tan_7ea104(); +} diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl new file mode 100644 index 0000000000..f31a310189 --- /dev/null +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tan_7ea104() { + float3 res = tan(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + tan_7ea104(); + return; +} + +void fragment_main() { + tan_7ea104(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tan_7ea104(); + return; +} + diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl new file mode 100644 index 0000000000..17676af315 --- /dev/null +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tan_7ea104() { + float3 res = tan(float3()); +} + +vertex void vertex_main() { + tan_7ea104(); + return; +} + +fragment void fragment_main() { + tan_7ea104(); + return; +} + +kernel void compute_main() { + tan_7ea104(); + return; +} + diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm new file mode 100644 index 0000000000..226a7b014b --- /dev/null +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tan_7ea104 "tan_7ea104" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 + %tan_7ea104 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Tan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tan_7ea104 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tan_7ea104 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tan_7ea104 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl new file mode 100644 index 0000000000..4e6f0f5df8 --- /dev/null +++ b/test/intrinsics/gen/tan/7ea104.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tan_7ea104() { + var res : vec3 = tan(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_7ea104(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_7ea104(); +} + +[[stage(compute)]] +fn compute_main() { + tan_7ea104(); +} diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl new file mode 100644 index 0000000000..b62fa47e6d --- /dev/null +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tan_8ce3e9() { + var res: vec2 = tan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_8ce3e9(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_8ce3e9(); +} + +[[stage(compute)]] +fn compute_main() { + tan_8ce3e9(); +} diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl new file mode 100644 index 0000000000..ab79f9acab --- /dev/null +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tan_8ce3e9() { + float2 res = tan(float2(0.0f, 0.0f)); +} + +void vertex_main() { + tan_8ce3e9(); + return; +} + +void fragment_main() { + tan_8ce3e9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tan_8ce3e9(); + return; +} + diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl new file mode 100644 index 0000000000..bad2f53d2d --- /dev/null +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tan_8ce3e9() { + float2 res = tan(float2()); +} + +vertex void vertex_main() { + tan_8ce3e9(); + return; +} + +fragment void fragment_main() { + tan_8ce3e9(); + return; +} + +kernel void compute_main() { + tan_8ce3e9(); + return; +} + diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm new file mode 100644 index 0000000000..d02318db8c --- /dev/null +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tan_8ce3e9 "tan_8ce3e9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 + %tan_8ce3e9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Tan %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tan_8ce3e9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tan_8ce3e9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tan_8ce3e9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl new file mode 100644 index 0000000000..b7b3c291dc --- /dev/null +++ b/test/intrinsics/gen/tan/8ce3e9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tan_8ce3e9() { + var res : vec2 = tan(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + tan_8ce3e9(); +} + +[[stage(fragment)]] +fn fragment_main() { + tan_8ce3e9(); +} + +[[stage(compute)]] +fn compute_main() { + tan_8ce3e9(); +} diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl new file mode 100644 index 0000000000..58def07970 --- /dev/null +++ b/test/intrinsics/gen/tanh/5663c5.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tanh_5663c5() { + var res: vec4 = tanh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_5663c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_5663c5(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_5663c5(); +} diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl new file mode 100644 index 0000000000..6a10df24e5 --- /dev/null +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tanh_5663c5() { + float4 res = tanh(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + tanh_5663c5(); + return; +} + +void fragment_main() { + tanh_5663c5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tanh_5663c5(); + return; +} + diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl new file mode 100644 index 0000000000..326f847d23 --- /dev/null +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tanh_5663c5() { + float4 res = tanh(float4()); +} + +vertex void vertex_main() { + tanh_5663c5(); + return; +} + +fragment void fragment_main() { + tanh_5663c5(); + return; +} + +kernel void compute_main() { + tanh_5663c5(); + return; +} + diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm new file mode 100644 index 0000000000..6484100edc --- /dev/null +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tanh_5663c5 "tanh_5663c5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%tanh_5663c5 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Tanh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tanh_5663c5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tanh_5663c5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tanh_5663c5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl new file mode 100644 index 0000000000..017fdaa8ad --- /dev/null +++ b/test/intrinsics/gen/tanh/5663c5.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tanh_5663c5() { + var res : vec4 = tanh(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_5663c5(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_5663c5(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_5663c5(); +} diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl new file mode 100644 index 0000000000..e832a46a5e --- /dev/null +++ b/test/intrinsics/gen/tanh/5724b3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tanh_5724b3() { + var res: vec2 = tanh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_5724b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_5724b3(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_5724b3(); +} diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl new file mode 100644 index 0000000000..09ee1c550b --- /dev/null +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tanh_5724b3() { + float2 res = tanh(float2(0.0f, 0.0f)); +} + +void vertex_main() { + tanh_5724b3(); + return; +} + +void fragment_main() { + tanh_5724b3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tanh_5724b3(); + return; +} + diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl new file mode 100644 index 0000000000..d87dbf73db --- /dev/null +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tanh_5724b3() { + float2 res = tanh(float2()); +} + +vertex void vertex_main() { + tanh_5724b3(); + return; +} + +fragment void fragment_main() { + tanh_5724b3(); + return; +} + +kernel void compute_main() { + tanh_5724b3(); + return; +} + diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm new file mode 100644 index 0000000000..573f7ef486 --- /dev/null +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tanh_5724b3 "tanh_5724b3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%tanh_5724b3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Tanh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tanh_5724b3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tanh_5724b3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tanh_5724b3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl new file mode 100644 index 0000000000..64efc2b6d5 --- /dev/null +++ b/test/intrinsics/gen/tanh/5724b3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tanh_5724b3() { + var res : vec2 = tanh(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_5724b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_5724b3(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_5724b3(); +} diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl new file mode 100644 index 0000000000..5461f604bc --- /dev/null +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tanh_9f9fb9() { + var res: vec3 = tanh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_9f9fb9(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_9f9fb9(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_9f9fb9(); +} diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl new file mode 100644 index 0000000000..981877b70f --- /dev/null +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tanh_9f9fb9() { + float3 res = tanh(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + tanh_9f9fb9(); + return; +} + +void fragment_main() { + tanh_9f9fb9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tanh_9f9fb9(); + return; +} + diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl new file mode 100644 index 0000000000..2eac415cda --- /dev/null +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tanh_9f9fb9() { + float3 res = tanh(float3()); +} + +vertex void vertex_main() { + tanh_9f9fb9(); + return; +} + +fragment void fragment_main() { + tanh_9f9fb9(); + return; +} + +kernel void compute_main() { + tanh_9f9fb9(); + return; +} + diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm new file mode 100644 index 0000000000..3f448b6e6f --- /dev/null +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tanh_9f9fb9 "tanh_9f9fb9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%tanh_9f9fb9 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Tanh %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %tanh_9f9fb9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %tanh_9f9fb9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %tanh_9f9fb9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl new file mode 100644 index 0000000000..ff29472595 --- /dev/null +++ b/test/intrinsics/gen/tanh/9f9fb9.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tanh_9f9fb9() { + var res : vec3 = tanh(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_9f9fb9(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_9f9fb9(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_9f9fb9(); +} diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl new file mode 100644 index 0000000000..55d3294f79 --- /dev/null +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn tanh_c15fdb() { + var res: f32 = tanh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_c15fdb(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_c15fdb(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_c15fdb(); +} diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl new file mode 100644 index 0000000000..863893507e --- /dev/null +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void tanh_c15fdb() { + float res = tanh(1.0f); +} + +void vertex_main() { + tanh_c15fdb(); + return; +} + +void fragment_main() { + tanh_c15fdb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + tanh_c15fdb(); + return; +} + diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl new file mode 100644 index 0000000000..ca7aebecad --- /dev/null +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void tanh_c15fdb() { + float res = tanh(1.0f); +} + +vertex void vertex_main() { + tanh_c15fdb(); + return; +} + +fragment void fragment_main() { + tanh_c15fdb(); + return; +} + +kernel void compute_main() { + tanh_c15fdb(); + return; +} + diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm new file mode 100644 index 0000000000..250c6b2fb3 --- /dev/null +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %tanh_c15fdb "tanh_c15fdb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%tanh_c15fdb = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Tanh %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %tanh_c15fdb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %tanh_c15fdb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %tanh_c15fdb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl new file mode 100644 index 0000000000..ecd8766fb7 --- /dev/null +++ b/test/intrinsics/gen/tanh/c15fdb.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn tanh_c15fdb() { + var res : f32 = tanh(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + tanh_c15fdb(); +} + +[[stage(fragment)]] +fn fragment_main() { + tanh_c15fdb(); +} + +[[stage(compute)]] +fn compute_main() { + tanh_c15fdb(); +} diff --git a/test/intrinsics/gen/textureDimensions/002b2a.wgsl b/test/intrinsics/gen/textureDimensions/002b2a.wgsl new file mode 100644 index 0000000000..718b2a9609 --- /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; +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 0000000000..d83530e59e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..736870d57a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2dc45cf002 --- /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 0000000000..20d2b0f651 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/002b2a.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +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 0000000000..69ae40d39e --- /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; +fn textureDimensions_012b82() { + var res: vec2 = 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 0000000000..a192aa3bd2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..701bdde822 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/012b82.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c8b4b79775 --- /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 0000000000..7a5470d576 --- /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; + +fn textureDimensions_012b82() { + var res : vec2 = 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 0000000000..ba9471bb69 --- /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; +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 0000000000..e414fdbb52 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..9747407006 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/08753d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..9ab3e11ada --- /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 0000000000..dde90103b5 --- /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; + +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 0000000000..6cf4810c2d --- /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; +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 0000000000..daea9af714 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..9091d77a23 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/08a62e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0eca5b3236 --- /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 0000000000..fad47a1cf7 --- /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; + +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 0000000000..2e4dc907c4 --- /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; +fn textureDimensions_0a5fcf() { + var res: vec2 = 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 0000000000..d269b4861e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..c47cacc894 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0a5fcf.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7f18747195 --- /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 0000000000..14574cf368 --- /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; + +fn textureDimensions_0a5fcf() { + var res : vec2 = 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 0000000000..c74f80fbe2 --- /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; +fn textureDimensions_0bab57() { + var res: vec3 = 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 0000000000..74e27fc871 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..26f279e191 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0bab57.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d0652c23a4 --- /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 0000000000..3ba0ffc9ed --- /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; + +fn textureDimensions_0bab57() { + var res : vec3 = 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 0000000000..d880ebae5c --- /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; +fn textureDimensions_0c4772() { + var res: vec3 = 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 0000000000..6aa502f917 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..2185536c8a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0c4772.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3c1c1c08da --- /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 0000000000..8721c37439 --- /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; + +fn textureDimensions_0c4772() { + var res : vec3 = 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 0000000000..8e54db431b --- /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; +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 0000000000..7b1dcc7d40 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..b771ab7c06 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0cce40.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..98ecb89c9d --- /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 0000000000..fd78266740 --- /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; + +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 0000000000..4b75932061 --- /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; +fn textureDimensions_0cf2ff() { + var res: vec2 = 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 0000000000..738b5bec7a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..41747da143 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0cf2ff.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..40c71094a0 --- /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 0000000000..21b0006753 --- /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; + +fn textureDimensions_0cf2ff() { + var res : vec2 = 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 0000000000..0946237a10 --- /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; +fn textureDimensions_0d8b7e() { + var res: vec2 = 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 0000000000..06bf8728a8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..50cf96a22a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0d8b7e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e8b582b0ff --- /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 0000000000..c0c36bfe7c --- /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; + +fn textureDimensions_0d8b7e() { + var res : vec2 = 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 0000000000..a242d8ef25 --- /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; +fn textureDimensions_0e32ee() { + var res: vec3 = 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 0000000000..7146aa7d65 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..ba2297d372 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0e32ee.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c53b4b1af1 --- /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 0000000000..b32e2ea291 --- /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; + +fn textureDimensions_0e32ee() { + var res : vec3 = 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 0000000000..a2a7a525be --- /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; +fn textureDimensions_0f3c50() { + var res: vec2 = 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 0000000000..abf7390688 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..6c2793a007 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/0f3c50.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0091be231b --- /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 0000000000..ce1a4f3560 --- /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; + +fn textureDimensions_0f3c50() { + var res : vec2 = 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 0000000000..a460387157 --- /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; +fn textureDimensions_1147d6() { + var res: vec2 = 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 0000000000..b1318e5ca7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..37d8bdb441 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1147d6.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7c586a912e --- /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 0000000000..d510726fe2 --- /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; + +fn textureDimensions_1147d6() { + var res : vec2 = 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 0000000000..b846121413 --- /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; +fn textureDimensions_1191a5() { + var res: vec2 = 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 0000000000..561d7d4128 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..c20ed0cb28 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c94df748a2 --- /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 0000000000..d17c8a98cd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1191a5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_1191a5() { + var res : vec2 = 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 0000000000..e99292bba4 --- /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 = 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 0000000000..e2fbea5e38 --- /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 0000000000..29197a2ca6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/12c9bb.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ff69832d91 --- /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 0000000000..a9e20d614d --- /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 = 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 0000000000..f0dbaf2220 --- /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; +fn textureDimensions_147998() { + var res: vec2 = 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 0000000000..eff5508cff --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..b8a7f49ea3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/147998.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2295a195bd --- /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 0000000000..cc32bc401b --- /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; + +fn textureDimensions_147998() { + var res : vec2 = 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 0000000000..55224db90d --- /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; +fn textureDimensions_16036c() { + var res: vec2 = 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 0000000000..f358c2a5fa --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..3509672bd8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/16036c.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8498e15166 --- /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 0000000000..3972668f4e --- /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; + +fn textureDimensions_16036c() { + var res : vec2 = 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 0000000000..ae55f61ad6 --- /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; +fn textureDimensions_168fcc() { + var res: vec2 = 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 0000000000..45811efd15 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..77c4feaef3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/168fcc.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b9b2a43a68 --- /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 0000000000..50cebb341a --- /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; + +fn textureDimensions_168fcc() { + var res : vec2 = 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 0000000000..9579b95a50 --- /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; +fn textureDimensions_183b3e() { + var res: vec3 = 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 0000000000..764248cbb6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..f613834f8a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3a6eb226ca --- /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 0000000000..d2bc85f76d --- /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; + +fn textureDimensions_183b3e() { + var res : vec3 = 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 0000000000..d4582537dd --- /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; +fn textureDimensions_18bd57() { + var res: vec2 = 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 0000000000..14127efed3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..1e1ae1e3f0 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/18bd57.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..70b169b06f --- /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 0000000000..01698c5e18 --- /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; + +fn textureDimensions_18bd57() { + var res : vec2 = 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 0000000000..21137dc607 --- /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; +fn textureDimensions_19bffc() { + var res: vec3 = 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 0000000000..dbcc08dbfb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..d0cac34ae2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/19bffc.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5d81c19bc7 --- /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 0000000000..e0135b0cca --- /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; + +fn textureDimensions_19bffc() { + var res : vec3 = 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 0000000000..30f31eade0 --- /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; +fn textureDimensions_1a58e7() { + var res: vec2 = 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 0000000000..565d342b9e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..80d0a7230b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1a58e7.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..504d710aef --- /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 0000000000..2706764f93 --- /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; + +fn textureDimensions_1a58e7() { + var res : vec2 = 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 0000000000..b39067c6fb --- /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; +fn textureDimensions_1aa199() { + var res: vec2 = 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 0000000000..bd8d2e1b44 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..9f17d36096 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1aa199.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..682bb7819b --- /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 0000000000..e04a103d8b --- /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; + +fn textureDimensions_1aa199() { + var res : vec2 = 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 0000000000..396abe2d5e --- /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; +fn textureDimensions_1b71f0() { + var res: vec3 = 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 0000000000..af31554aad --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..3cf91c487c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1b71f0.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..1a854e4ae8 --- /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 0000000000..e9f02beed3 --- /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; + +fn textureDimensions_1b71f0() { + var res : vec3 = 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 0000000000..29be560bf5 --- /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; +fn textureDimensions_1d6c26() { + var res: vec2 = 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 0000000000..a4964426c2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..96b2fa17cb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1d6c26.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..91f238ada1 --- /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 0000000000..fa330093e4 --- /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; + +fn textureDimensions_1d6c26() { + var res : vec2 = 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 0000000000..2234edafe2 --- /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; +fn textureDimensions_1e189c() { + var res: vec3 = 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 0000000000..be9b5ff554 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..d42dd47006 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1e189c.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..eb6508a2f6 --- /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 0000000000..7959299deb --- /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; + +fn textureDimensions_1e189c() { + var res : vec3 = 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 0000000000..e109c3c2ba --- /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; +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 0000000000..a77efc4859 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..a9f4a053ad --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1e9e39.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..33b27728e9 --- /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 0000000000..7aee504e6a --- /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; + +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 0000000000..a1468f4be9 --- /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; +fn textureDimensions_1ebd6a() { + var res: vec3 = 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 0000000000..8cd7608bcc --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..95dc541486 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..dd9af14056 --- /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 0000000000..da5ca1c0b7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_1ebd6a() { + var res : vec3 = 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 0000000000..333146a878 --- /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; +fn textureDimensions_1f20c5() { + var res: vec2 = 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 0000000000..bc07afa231 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..cc39489d59 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/1f20c5.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c7c82c8914 --- /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 0000000000..dce90c102a --- /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; + +fn textureDimensions_1f20c5() { + var res : vec2 = 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 0000000000..053eab16e7 --- /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; +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 0000000000..e3c3205e82 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..3ba81a2eb1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/214b7b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..19b3b6deb4 --- /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 0000000000..5a63062e9c --- /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; + +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 0000000000..042c0ed45e --- /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; +fn textureDimensions_214dd4() { + var res: vec3 = 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 0000000000..9a51609768 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..cf5792a4a1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/214dd4.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3db1b54cb2 --- /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 0000000000..de7e3bbc84 --- /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; + +fn textureDimensions_214dd4() { + var res : vec3 = 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 0000000000..83b5d07b88 --- /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; +fn textureDimensions_267788() { + var res: vec2 = 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 0000000000..aa6b355b58 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..457b334db2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/267788.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d0154aa147 --- /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 0000000000..177cdb29a4 --- /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; + +fn textureDimensions_267788() { + var res : vec2 = 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 0000000000..445a6d2d77 --- /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; +fn textureDimensions_26bdfa() { + var res: vec3 = 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 0000000000..f6e82ab906 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..dbc0fde045 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..80e60286ac --- /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 0000000000..10d89c335e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/26bdfa.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_26bdfa() { + var res : vec3 = 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 0000000000..e197ab20e6 --- /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; +fn textureDimensions_26ef6c() { + var res: vec2 = 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 0000000000..9e11e83f82 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..332afa32da --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/26ef6c.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..26609c2afb --- /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 0000000000..ccf7e79b73 --- /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; + +fn textureDimensions_26ef6c() { + var res : vec2 = 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 0000000000..e10201e37b --- /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; +fn textureDimensions_2ad087() { + var res: vec2 = 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 0000000000..82c4e11237 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..60571a7a6c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2ad087.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..74f5e24a22 --- /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 0000000000..095ee44b69 --- /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; + +fn textureDimensions_2ad087() { + var res : vec2 = 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 0000000000..8a96df2658 --- /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; +fn textureDimensions_2d32ae() { + var res: vec3 = 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 0000000000..83d3b36ef6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..a278b6cf69 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2d32ae.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..96c6b4ca15 --- /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 0000000000..61b01c9343 --- /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; + +fn textureDimensions_2d32ae() { + var res : vec3 = 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 0000000000..fc5760d07e --- /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; +fn textureDimensions_2e0662() { + var res: vec2 = 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 0000000000..30d3b5361a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..4a03532d16 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2e0662.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8b365dab5a --- /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 0000000000..39f4bbddb6 --- /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; + +fn textureDimensions_2e0662() { + var res : vec2 = 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 0000000000..88c2c9f054 --- /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; +fn textureDimensions_2efa05() { + var res: vec3 = 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 0000000000..5175bdd76b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..38226ec73f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ecba548352 --- /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 0000000000..02c2e5aeb4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2efa05.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_2efa05() { + var res : vec3 = 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 0000000000..cc718aaff2 --- /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; +fn textureDimensions_2f289f() { + var res: vec3 = 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 0000000000..ee4cc4c8a1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..6aaf3be66a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2f289f.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4d2be754d7 --- /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 0000000000..cb95ece6b8 --- /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; + +fn textureDimensions_2f289f() { + var res : vec3 = 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 0000000000..dfa4db2ea8 --- /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; +fn textureDimensions_2fe1cc() { + var res: vec2 = 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 0000000000..a2d49c88b7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..1090ab70cd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..76ece0db86 --- /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 0000000000..215ce6a4e2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/2fe1cc.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_2fe1cc() { + var res : vec2 = 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 0000000000..29b4ad5270 --- /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; +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 0000000000..ad7854dfc2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..55c6228b01 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/318ecc.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..9cd91c9f07 --- /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 0000000000..4332a639c7 --- /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; + +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 0000000000..7d8e7bab00 --- /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; +fn textureDimensions_340d06() { + var res: vec3 = 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 0000000000..341d62a2e9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..3b0ea883f4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/340d06.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5ededabe7c --- /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 0000000000..aca58adc9d --- /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; + +fn textureDimensions_340d06() { + var res : vec3 = 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 0000000000..a6f3ad99b7 --- /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; +fn textureDimensions_398e30() { + var res: vec2 = 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 0000000000..43f9e21a11 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..d19328ec2e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/398e30.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d2c4d31eb0 --- /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 0000000000..50376ffad8 --- /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; + +fn textureDimensions_398e30() { + var res : vec2 = 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 0000000000..a06623f53f --- /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; +fn textureDimensions_39a600() { + var res: vec2 = 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 0000000000..bb63468551 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..585dd48c8c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/39a600.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b5f190c29a --- /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 0000000000..5915c37c63 --- /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; + +fn textureDimensions_39a600() { + var res : vec2 = 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 0000000000..ad3a697aba --- /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; +fn textureDimensions_3a94ea() { + var res: vec2 = 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 0000000000..984a409a51 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..baedbc72f8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3a94ea.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e1132c36b4 --- /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 0000000000..f1acdc1712 --- /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; + +fn textureDimensions_3a94ea() { + var res : vec2 = 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 0000000000..e9735cee84 --- /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; +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 0000000000..5a88e3b81a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..e12c743704 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3aca08.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a191b3ef3a --- /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 0000000000..2c8cb959e4 --- /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; + +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 0000000000..30d77c0c0b --- /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; +fn textureDimensions_3c5ad8() { + var res: vec2 = 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 0000000000..15ccdf1b0d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..42638895a8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3c5ad8.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..90d93e522c --- /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 0000000000..ea66097a3e --- /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; + +fn textureDimensions_3c5ad8() { + var res : vec2 = 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 0000000000..f09f6f38e6 --- /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; +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 0000000000..28ac7bf994 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..9b81afbb71 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3d5817.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..f33f81e348 --- /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 0000000000..21e8ab0fbe --- /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; + +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 0000000000..ab806b3bda --- /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; +fn textureDimensions_3e0403() { + var res: vec3 = 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 0000000000..bdad7cf7d9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..73a0f66630 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..41e422de85 --- /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 0000000000..769dcc4db7 --- /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; + +fn textureDimensions_3e0403() { + var res : vec3 = 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 0000000000..14d0b6381e --- /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 = 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 0000000000..a279501081 --- /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 0000000000..8821401bab --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..056eb243cd --- /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 0000000000..1fb3dbd42e --- /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 = 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 0000000000..f8f4dd46f1 --- /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; +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 0000000000..5a4ba74792 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..ab8ed04d22 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/40bc10.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..228f0b5deb --- /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 0000000000..0727714fe9 --- /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; + +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 0000000000..f451b22179 --- /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; +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 0000000000..2896dccad8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..7a76a75352 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..75aeca4ae9 --- /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 0000000000..1b008ff3d8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/423f99.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +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 0000000000..1d1c2ef5b8 --- /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; +fn textureDimensions_4267ee() { + var res: vec2 = 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 0000000000..aef602da9b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..a494763d64 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/4267ee.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5e24b4ebc8 --- /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 0000000000..05b48affb9 --- /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; + +fn textureDimensions_4267ee() { + var res : vec2 = 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 0000000000..d2454e4f53 --- /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; +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 0000000000..6fc1b1a198 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..35fac39647 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/42d4e6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..1291134b7b --- /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 0000000000..92708fb50d --- /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; + +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 0000000000..937d79b866 --- /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; +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 0000000000..67d2344aa3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..981210f179 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/441392.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..fb56b4fb1d --- /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 0000000000..432e612b14 --- /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; + +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 0000000000..60991cd09b --- /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; +fn textureDimensions_48cb89() { + var res: vec2 = 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 0000000000..9f45377b58 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..52b7fa86c2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48cb89.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c149ebe117 --- /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 0000000000..aaa4c33071 --- /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; + +fn textureDimensions_48cb89() { + var res : vec2 = 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 0000000000..38ecb4d51f --- /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; +fn textureDimensions_48cbb2() { + var res: vec2 = 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 0000000000..979d34f67d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..8ce4bb7a7c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48cbb2.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..54fe42739c --- /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 0000000000..180ebcf6c2 --- /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; + +fn textureDimensions_48cbb2() { + var res : vec2 = 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 0000000000..9e24a9ebfd --- /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; +fn textureDimensions_48f360() { + var res: vec2 = 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 0000000000..9fbc6c7960 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..5757db61f1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/48f360.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b86a2ec3d6 --- /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 0000000000..3fa6ac8c46 --- /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; + +fn textureDimensions_48f360() { + var res : vec2 = 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 0000000000..25adf507be --- /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; +fn textureDimensions_49d274() { + var res: vec2 = 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 0000000000..1523867b20 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..fe0d210a55 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/49d274.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..099c090660 --- /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 0000000000..3a08eceb46 --- /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; + +fn textureDimensions_49d274() { + var res : vec2 = 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 0000000000..fe40ade611 --- /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; +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 0000000000..1203833d4b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..38a04a9b48 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/4df9a8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2aa1708a9f --- /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 0000000000..7c597ef713 --- /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; + +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 0000000000..3d070db896 --- /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; +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 0000000000..b5954430c2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..72474f381f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/55b23e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4899a5fbde --- /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 0000000000..bb617face5 --- /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; + +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 0000000000..479a5c5d07 --- /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; +fn textureDimensions_56ccfa() { + var res: vec3 = 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 0000000000..f6855febed --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..287a2995f4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/56ccfa.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0cc05de6b7 --- /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 0000000000..caa5fca395 --- /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; + +fn textureDimensions_56ccfa() { + var res : vec3 = 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 0000000000..19fb810872 --- /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; +fn textureDimensions_579629() { + var res: vec2 = 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 0000000000..797af6b740 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS 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 0000000000..535dea4a87 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/579629.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7de9341f11 --- /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 0000000000..2b6608f73e --- /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; + +fn textureDimensions_579629() { + var res : vec2 = 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 0000000000..7f4e08fa09 --- /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; +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 0000000000..3c8852be80 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..0f18c54687 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/57da0b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b61901170f --- /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 0000000000..c28634f126 --- /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; + +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 0000000000..6b07538a11 --- /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; +fn textureDimensions_57e7b3() { + var res: vec3 = 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 0000000000..bf491cb4da --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..1cd19c3ddd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/57e7b3.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..501de7b855 --- /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 0000000000..2de1c5de30 --- /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; + +fn textureDimensions_57e7b3() { + var res : vec3 = 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 0000000000..abe400b86f --- /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; +fn textureDimensions_58a515() { + var res: vec2 = 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 0000000000..dde543e56b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..1adcb54111 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/58a515.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c0f19b4135 --- /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 0000000000..c909b43341 --- /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; + +fn textureDimensions_58a515() { + var res : vec2 = 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 0000000000..2b877085f4 --- /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; +fn textureDimensions_5985f3() { + var res: vec2 = 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 0000000000..9bd1140ac9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..c012972165 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5985f3.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..fa73029fca --- /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 0000000000..28e8229f53 --- /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; + +fn textureDimensions_5985f3() { + var res : vec2 = 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 0000000000..c907865ae5 --- /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; +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 0000000000..d250720dd9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..3d20f6842e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5caa5e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4890feec72 --- /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 0000000000..f1dfd35021 --- /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; + +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 0000000000..be0e8ed7f7 --- /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; +fn textureDimensions_5e295d() { + var res: vec2 = 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 0000000000..3123bda5d5 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..ce3951e92d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5e295d.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..bb02735845 --- /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 0000000000..493103b12e --- /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; + +fn textureDimensions_5e295d() { + var res : vec2 = 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 0000000000..839f64a62f --- /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; +fn textureDimensions_5ec4e1() { + var res: vec3 = 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 0000000000..4aa8f3e862 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..2f6bffb152 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2e4dbd221c --- /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 0000000000..b0aa472241 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_5ec4e1() { + var res : vec3 = 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 0000000000..5a1f3c48aa --- /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; +fn textureDimensions_60bf54() { + var res: vec3 = 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 0000000000..34334eec64 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..1018d0adce --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/60bf54.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..89807598d5 --- /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 0000000000..f2dd194188 --- /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; + +fn textureDimensions_60bf54() { + var res : vec3 = 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 0000000000..1a87d612e1 --- /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; +fn textureDimensions_63f3cf() { + var res: vec3 = 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 0000000000..fcfed00657 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..8d6a0b774a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/63f3cf.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..35ab54b738 --- /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 0000000000..b408be4f90 --- /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; + +fn textureDimensions_63f3cf() { + var res : vec3 = 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 0000000000..6fe34764d4 --- /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; +fn textureDimensions_66dc4e() { + var res: vec2 = 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 0000000000..0c86dc6493 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..96ac5f30b7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/66dc4e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..63ab7f6d79 --- /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 0000000000..35b621a640 --- /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; + +fn textureDimensions_66dc4e() { + var res : vec2 = 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 0000000000..1893db1c76 --- /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; +fn textureDimensions_670d90() { + var res: vec3 = 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 0000000000..8da3ae1776 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..e392d86ed5 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/670d90.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..09d9df8006 --- /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 0000000000..553906b742 --- /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; + +fn textureDimensions_670d90() { + var res : vec3 = 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 0000000000..47040f31c9 --- /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; +fn textureDimensions_68105c() { + var res: vec2 = 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 0000000000..01c571d1e9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..7908305ecb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/68105c.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2f3a80114d --- /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 0000000000..979666edfd --- /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; + +fn textureDimensions_68105c() { + var res : vec2 = 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 0000000000..8ed6e68db4 --- /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; +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 0000000000..8e90341d49 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..7c2faab988 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6adac6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0030afdc85 --- /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 0000000000..ef544c700d --- /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; + +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 0000000000..6560c31078 --- /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; +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 0000000000..a4b0f25dab --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..35a39737a0 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6c08ab.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4f28d72278 --- /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 0000000000..a43bd5dcf0 --- /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; + +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 0000000000..5f143a0952 --- /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; +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 0000000000..68c8298397 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..e74d8c8575 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6e2d12.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3be8eef325 --- /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 0000000000..c1496a75da --- /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; + +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 0000000000..a8f2f38305 --- /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; +fn textureDimensions_6ec1b4() { + var res: vec3 = 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 0000000000..f32020e70a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..17889b570f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..69bfc0076d --- /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 0000000000..543e010b04 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6ec1b4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_6ec1b4() { + var res : vec3 = 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 0000000000..81d1dd742c --- /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; +fn textureDimensions_6f0d79() { + var res: vec2 = 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 0000000000..f64072da2e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..979f71a814 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/6f0d79.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..207ca7b538 --- /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 0000000000..77931a9974 --- /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; + +fn textureDimensions_6f0d79() { + var res : vec2 = 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 0000000000..ab009e8e7e --- /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; +fn textureDimensions_702c53() { + var res: vec2 = 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 0000000000..3900595213 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..5120e5920f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/702c53.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2054bf8cbd --- /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 0000000000..79bc870b24 --- /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; + +fn textureDimensions_702c53() { + var res : vec2 = 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 0000000000..c51357229f --- /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; +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 0000000000..80e8478c1a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..15a4b62e71 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/70e26a.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..93669b5d19 --- /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 0000000000..5fa2f99b16 --- /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; + +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 0000000000..5c3f959135 --- /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; +fn textureDimensions_71e8f7() { + var res: vec2 = 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 0000000000..27bb78a7f3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..6fa1f68499 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/71e8f7.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..659fd98b9a --- /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 0000000000..a78950c7af --- /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; + +fn textureDimensions_71e8f7() { + var res : vec2 = 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 0000000000..33045e75ac --- /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 = 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 0000000000..f7a5391098 --- /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 0000000000..8367897aef --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/72e5d6.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..09ce4e7013 --- /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 0000000000..d81fb59af3 --- /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 = 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 0000000000..e3135e0a40 --- /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; +fn textureDimensions_75be9d() { + var res: vec3 = 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 0000000000..4847eda7e7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..4cfb4d449b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..85976e751b --- /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 0000000000..65e0b26948 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_75be9d() { + var res : vec3 = 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 0000000000..641a9225c3 --- /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 = 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 0000000000..f8e330d124 --- /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 0000000000..3be4993b14 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..2f5aadde03 --- /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 0000000000..e69e66fe1c --- /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 = 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 0000000000..bf9e0d9fb6 --- /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; +fn textureDimensions_770103() { + var res: vec3 = 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 0000000000..70cf96ca9a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..f65d8cdfe0 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/770103.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0847108a4f --- /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 0000000000..9e79ca4244 --- /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; + +fn textureDimensions_770103() { + var res : vec3 = 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 0000000000..3b5d490e5f --- /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; +fn textureDimensions_7bb707() { + var res: vec3 = 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 0000000000..9c245c2676 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..7fe0dd5a99 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..993f04a398 --- /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 0000000000..00428674ed --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_7bb707() { + var res : vec3 = 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 0000000000..d8c9051474 --- /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 = 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 0000000000..50ced2c2ed --- /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 0000000000..7f217c2107 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7bf826.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e898a264dc --- /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 0000000000..112470d241 --- /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 = 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 0000000000..0f7628856c --- /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; +fn textureDimensions_7f5c2e() { + var res: vec2 = 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 0000000000..a5c971c30f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..8f23096c4c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/7f5c2e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ea3ec8cac6 --- /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 0000000000..3295f7812f --- /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; + +fn textureDimensions_7f5c2e() { + var res : vec2 = 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 0000000000..b6a6b4b813 --- /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; +fn textureDimensions_8028f3() { + var res: vec3 = 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 0000000000..bd8d496c45 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..8563a2717d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8028f3.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8eedc4b545 --- /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 0000000000..75cf9c5cab --- /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; + +fn textureDimensions_8028f3() { + var res : vec3 = 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 0000000000..184ac8f9f0 --- /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; +fn textureDimensions_811679() { + var res: vec3 = 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 0000000000..b01fc27e8f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..963c63400f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/811679.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..235e2f97f9 --- /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 0000000000..20d46b42aa --- /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; + +fn textureDimensions_811679() { + var res : vec3 = 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 0000000000..e4fbff78ad --- /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; +fn textureDimensions_820596() { + var res: vec3 = 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 0000000000..0130c6e1bd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..83c960f830 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/820596.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..cfa018e1c7 --- /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 0000000000..82ef750326 --- /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; + +fn textureDimensions_820596() { + var res : vec3 = 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 0000000000..adc59d2184 --- /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; +fn textureDimensions_82138e() { + var res: vec2 = 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 0000000000..2f824cf6e4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..83d6afb4b6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/82138e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..22715d59bf --- /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 0000000000..7e214451f3 --- /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; + +fn textureDimensions_82138e() { + var res : vec2 = 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 0000000000..80ade64e15 --- /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; +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 0000000000..eb82bb91c7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..a000567bef --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8347ab.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..63f5a4a014 --- /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 0000000000..2ad5bcbdb6 --- /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; + +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 0000000000..b275c0bad5 --- /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; +fn textureDimensions_83ee5a() { + var res: vec2 = 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 0000000000..e4628b80e0 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..7f51f22b35 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/83ee5a.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..46d81e1d82 --- /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 0000000000..c65be39413 --- /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; + +fn textureDimensions_83ee5a() { + var res : vec2 = 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 0000000000..d9e829bbd0 --- /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; +fn textureDimensions_85d556() { + var res: vec2 = 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 0000000000..ce3a43c34e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..f9e9e2e19c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/85d556.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ed97d5a762 --- /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 0000000000..d0074ca4c1 --- /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; + +fn textureDimensions_85d556() { + var res : vec2 = 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 0000000000..72469f38c4 --- /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; +fn textureDimensions_8799ee() { + var res: vec3 = 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 0000000000..149cef78d4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..aa12070a9a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8799ee.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5d3e426ac2 --- /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 0000000000..490113abd0 --- /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; + +fn textureDimensions_8799ee() { + var res : vec3 = 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 0000000000..778784c237 --- /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; +fn textureDimensions_89a864() { + var res: vec2 = 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 0000000000..77eda67d36 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..d851f90d2f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/89a864.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5d4534edcd --- /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 0000000000..d1c46bed0e --- /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; + +fn textureDimensions_89a864() { + var res : vec2 = 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 0000000000..ac87df5dd0 --- /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; +fn textureDimensions_8aa4c4() { + var res: vec3 = 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 0000000000..609c45ddc1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..0b9908245c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..232ff24713 --- /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 0000000000..cbf79d1047 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8aa4c4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_8aa4c4() { + var res : vec3 = 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 0000000000..7eb8bd5ed1 --- /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; +fn textureDimensions_8b4fff() { + var res: vec2 = 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 0000000000..ac00230170 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..24a76acdda --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8b4fff.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..6692c0f279 --- /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 0000000000..ee0d0f6967 --- /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; + +fn textureDimensions_8b4fff() { + var res : vec2 = 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 0000000000..e57c3b3de7 --- /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; +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 0000000000..ac6eff30e7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..5028c4037c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8d89f8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..69e2f9e741 --- /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 0000000000..af689920e0 --- /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; + +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 0000000000..6fdb2d4ccd --- /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; +fn textureDimensions_8deb5e() { + var res: vec3 = 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 0000000000..c4107a45bd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..2000e1866a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d30a10486d --- /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 0000000000..49748656b8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8deb5e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_8deb5e() { + var res : vec3 = 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 0000000000..bc6e1fa3bd --- /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; +fn textureDimensions_8fca0f() { + var res: vec3 = 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 0000000000..821460797c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..3466bc5c4b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/8fca0f.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8429e41f4f --- /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 0000000000..b901463cb6 --- /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; + +fn textureDimensions_8fca0f() { + var res : vec3 = 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 0000000000..9c96fb84eb --- /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; +fn textureDimensions_9042ab() { + var res: vec2 = 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 0000000000..a3b30b6c55 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..83b4534a48 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9042ab.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..62cae5671e --- /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 0000000000..b7936eed31 --- /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; + +fn textureDimensions_9042ab() { + var res : vec2 = 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 0000000000..d0da65ccdb --- /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; +fn textureDimensions_91f42d() { + var res: vec3 = 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 0000000000..507282e3f6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..2a44126de2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..02e408d8d4 --- /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 0000000000..2fbb19129c --- /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; + +fn textureDimensions_91f42d() { + var res : vec3 = 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 0000000000..8866e2d376 --- /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; +fn textureDimensions_924742() { + var res: vec3 = 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 0000000000..9485df78e9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..af8bd0adb1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/924742.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..cd49cac1f9 --- /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 0000000000..f497afac19 --- /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; + +fn textureDimensions_924742() { + var res : vec3 = 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 0000000000..c2f758f463 --- /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; +fn textureDimensions_92ad20() { + var res: vec3 = 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 0000000000..847c0c8b83 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..9e963acaa7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/92ad20.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7bfccd3632 --- /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 0000000000..f66e8a89ce --- /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; + +fn textureDimensions_92ad20() { + var res : vec3 = 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 0000000000..1c92cdec4d --- /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 = 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 0000000000..66e508680e --- /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 0000000000..8f97c1b5db --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/939fdb.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a219560cf0 --- /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 0000000000..afb11dfd26 --- /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 = 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 0000000000..17c6b566f6 --- /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; +fn textureDimensions_9572e5() { + var res: vec3 = 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 0000000000..3e53391581 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..55bbe37d15 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9572e5.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..6b65e7c281 --- /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 0000000000..2c7584813e --- /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; + +fn textureDimensions_9572e5() { + var res : vec3 = 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 0000000000..3fb8e60bbb --- /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; +fn textureDimensions_998f6b() { + var res: vec2 = 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 0000000000..27f1091e2e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..b2a3245e6a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/998f6b.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0a970f29c7 --- /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 0000000000..e299aa92b2 --- /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; + +fn textureDimensions_998f6b() { + var res : vec2 = 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 0000000000..54066f9a91 --- /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; +fn textureDimensions_9abfe5() { + var res: vec2 = 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 0000000000..753587a10b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..f510b8db0c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9abfe5.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..610275795f --- /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 0000000000..1d0b4d5a77 --- /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; + +fn textureDimensions_9abfe5() { + var res : vec2 = 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 0000000000..6020ce438f --- /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; +fn textureDimensions_9c9c57() { + var res: vec2 = 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 0000000000..18217fc007 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..f8f5356b0a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9c9c57.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c6b4449420 --- /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 0000000000..20f18b75d9 --- /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; + +fn textureDimensions_9c9c57() { + var res : vec2 = 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 0000000000..58f651544d --- /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; +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 0000000000..3b3689ba5b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..6fb03a5ea1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9da9e2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e31891f813 --- /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 0000000000..042e71600a --- /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; + +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 0000000000..6a537c079b --- /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; +fn textureDimensions_9eb8d8() { + var res: vec2 = 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 0000000000..dcc6236ebd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..6d9361fda7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9eb8d8.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3882431fe2 --- /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 0000000000..0d67656639 --- /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; + +fn textureDimensions_9eb8d8() { + var res : vec2 = 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 0000000000..5688e42ae1 --- /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; +fn textureDimensions_9f8e46() { + var res: vec2 = 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 0000000000..0e573aadb3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..df82743476 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0167c50c25 --- /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 0000000000..be69dc6d47 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9f8e46.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_9f8e46() { + var res : vec2 = 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 0000000000..52a8778859 --- /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; +fn textureDimensions_a0aad1() { + var res: vec2 = 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 0000000000..02091582a1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..dee0891c59 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a0aad1.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..20969b8afe --- /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 0000000000..ecedf37f7c --- /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; + +fn textureDimensions_a0aad1() { + var res : vec2 = 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 0000000000..987701ca6b --- /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; +fn textureDimensions_a0e4ec() { + var res: vec3 = 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 0000000000..8938df93b3 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..62aed2c8d1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a0e4ec.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..aef6121883 --- /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 0000000000..fa2d645c3b --- /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; + +fn textureDimensions_a0e4ec() { + var res : vec3 = 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 0000000000..8509d5f3eb --- /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 = 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 0000000000..3485629a8b --- /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 0000000000..7955481faf --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e5d91598f3 --- /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 0000000000..2c6b2bcefe --- /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 = 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 0000000000..94542d3548 --- /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; +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 0000000000..aa02095b96 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..867a1b7cad --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..bf76e160af --- /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 0000000000..194c128e8b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a7d565.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +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 0000000000..104a9eeb14 --- /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; +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 0000000000..1cc4b99767 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..f44cdd5e2e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a863f2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3ec7cf7ed6 --- /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 0000000000..cfb185490e --- /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; + +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 0000000000..4b81975c03 --- /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; +fn textureDimensions_ae457f() { + var res: vec2 = 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 0000000000..67ab5d154c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..707857c6ab --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ae457f.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d65d2703c3 --- /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 0000000000..7764208948 --- /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; + +fn textureDimensions_ae457f() { + var res : vec2 = 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 0000000000..2f5db9e1d7 --- /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; +fn textureDimensions_b0e16d() { + var res: vec2 = 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 0000000000..9f083d50c1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..4749a7864b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7c076e6e3f --- /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 0000000000..6908dfb044 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/b0e16d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_b0e16d() { + var res : vec2 = 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 0000000000..da39110a4c --- /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; +fn textureDimensions_b91240() { + var res: vec2 = 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 0000000000..2b5ea2a16c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..a2c9940ccb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/b91240.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..0ce5cc8c0c --- /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 0000000000..18cb6c5c35 --- /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; + +fn textureDimensions_b91240() { + var res : vec2 = 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 0000000000..870a110637 --- /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 = 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 0000000000..b54cbda80d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..a4422c7a31 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ba1481.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..66376a0c01 --- /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 0000000000..7fad75b7b3 --- /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 = 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 0000000000..bb0be1d764 --- /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; +fn textureDimensions_ba6e15() { + var res: vec2 = 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 0000000000..aee8136c88 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..367a4096a9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ba6e15.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a49144e516 --- /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 0000000000..a1bde09818 --- /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; + +fn textureDimensions_ba6e15() { + var res : vec2 = 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 0000000000..c16641c302 --- /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; +fn textureDimensions_bb3dde() { + var res: vec3 = 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 0000000000..456c682160 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..dd2c2ef994 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/bb3dde.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e828d98cb3 --- /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 0000000000..e754d083b7 --- /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; + +fn textureDimensions_bb3dde() { + var res : vec3 = 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 0000000000..824cc371b5 --- /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 = 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 0000000000..d30974776b --- /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 0000000000..630b31fee5 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..95ab28977e --- /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 0000000000..97f89369d1 --- /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 = 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 0000000000..9a6a73195c --- /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; +fn textureDimensions_c2215f() { + var res: vec2 = 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 0000000000..dcb01ec09e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..57ddc42d56 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c2215f.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a4eb7112ff --- /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 0000000000..183517557d --- /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; + +fn textureDimensions_c2215f() { + var res : vec2 = 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 0000000000..3a270454dd --- /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; +fn textureDimensions_c30e75() { + var res: vec2 = 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 0000000000..2c32e82f71 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..074981fe12 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c30e75.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8e8edd9971 --- /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 0000000000..2419e830e0 --- /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; + +fn textureDimensions_c30e75() { + var res : vec2 = 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 0000000000..7e62f032b7 --- /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; +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 0000000000..21925cc445 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..10be8b6b6f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c60b66.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..339b5683ef --- /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 0000000000..9825a31813 --- /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; + +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 0000000000..d6eb0a14cc --- /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; +fn textureDimensions_c74533() { + var res: vec2 = 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 0000000000..bc9d1ef9a7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..49ee7a13d9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c74533.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..d03a057fd6 --- /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 0000000000..f232e4fb17 --- /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; + +fn textureDimensions_c74533() { + var res : vec2 = 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 0000000000..cc6af895a8 --- /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; +fn textureDimensions_c7943d() { + var res: vec2 = 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 0000000000..3c904238b7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..ba4f2af735 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/c7943d.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..7c935b0c02 --- /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 0000000000..bcb79d86df --- /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; + +fn textureDimensions_c7943d() { + var res : vec2 = 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 0000000000..e563cf293d --- /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; +fn textureDimensions_caaabb() { + var res: vec2 = 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 0000000000..69e4489b38 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..2d6d08a8dd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/caaabb.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..cb25aca237 --- /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 0000000000..90c1c289cb --- /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; + +fn textureDimensions_caaabb() { + var res : vec2 = 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 0000000000..ddf9b2c64c --- /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; +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 0000000000..0f9326ec51 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..bdfff9e870 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cc5478.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..6bec852cb6 --- /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 0000000000..baf34af8b2 --- /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; + +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 0000000000..53edbe6584 --- /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; +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 0000000000..34104045d9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..b306a45cd7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cc968c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a1322ae479 --- /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 0000000000..fa5b5b21bf --- /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; + +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 0000000000..4a950210cd --- /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; +fn textureDimensions_cccc17() { + var res: vec3 = 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 0000000000..743516c916 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..ab3854a966 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4d67eeb428 --- /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 0000000000..7b1d7bd718 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_cccc17() { + var res : vec3 = 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 0000000000..663339fea6 --- /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; +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 0000000000..0888f24a8b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..8a8b48b611 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cccc8f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ffb7c509b9 --- /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 0000000000..a7b4ce0162 --- /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; + +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 0000000000..5025753c95 --- /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; +fn textureDimensions_cd76a7() { + var res: vec3 = 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 0000000000..babcfe114b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..1b1d170317 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cd76a7.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b1b8e4953b --- /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 0000000000..ff0d168b0d --- /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; + +fn textureDimensions_cd76a7() { + var res : vec3 = 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 0000000000..2383f87c63 --- /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; +fn textureDimensions_cdaff9() { + var res: vec3 = 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 0000000000..c7fba3fb37 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..d1ae8a9c81 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cdaff9.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..ca690e7e7b --- /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 0000000000..f69c2b560a --- /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; + +fn textureDimensions_cdaff9() { + var res : vec3 = 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 0000000000..9a18a7d8af --- /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; +fn textureDimensions_cdf473() { + var res: vec2 = 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 0000000000..0c847dbcc4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..eb92cd3f56 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cdf473.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..674d1c4808 --- /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 0000000000..9f0229809c --- /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; + +fn textureDimensions_cdf473() { + var res : vec2 = 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 0000000000..f341fe2cb4 --- /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; +fn textureDimensions_cec841() { + var res: vec2 = 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 0000000000..44fed34b92 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..4f2cda2f4c --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cec841.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..caa966a6e4 --- /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 0000000000..fa1ee137a3 --- /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; + +fn textureDimensions_cec841() { + var res : vec2 = 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 0000000000..a06115f817 --- /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; +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 0000000000..06a13675fc --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..d69b8c75fb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cf1d42.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..03d962dc43 --- /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 0000000000..bdae356549 --- /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; + +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 0000000000..30cf75926b --- /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; +fn textureDimensions_cf7e43() { + var res: vec3 = 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 0000000000..b2e6947d7f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..23e8921c4a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/cf7e43.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..b268aaeb24 --- /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 0000000000..ccdd94f9dc --- /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; + +fn textureDimensions_cf7e43() { + var res : vec3 = 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 0000000000..2387895aa2 --- /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; +fn textureDimensions_d40b9e() { + var res: vec2 = 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 0000000000..2943bb5447 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..ebe5e39ce9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d40b9e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..9408183653 --- /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 0000000000..83398fb401 --- /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; + +fn textureDimensions_d40b9e() { + var res : vec2 = 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 0000000000..fee84c37e7 --- /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; +fn textureDimensions_d4106f() { + var res: vec2 = 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 0000000000..c38086ee47 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..f0448530d4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d4106f.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..5ab2c0b361 --- /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 0000000000..fd06290da6 --- /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; + +fn textureDimensions_d4106f() { + var res : vec2 = 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 0000000000..dc9570ab0c --- /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; +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 0000000000..819ca59af7 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..ed1390acf4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d8f951.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..16cdf49991 --- /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 0000000000..c41b14d7f5 --- /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; + +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 0000000000..5df347c42f --- /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; +fn textureDimensions_da3099() { + var res: vec3 = 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 0000000000..c474ad5ad8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..fc0d392d14 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/da3099.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..bf8331ecc1 --- /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 0000000000..cd9fdad396 --- /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; + +fn textureDimensions_da3099() { + var res : vec3 = 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 0000000000..35942795ec --- /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; +fn textureDimensions_daf7c0() { + var res: vec2 = 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 0000000000..df5ba6fc67 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS 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 0000000000..3f795189a9 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/daf7c0.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3f0b9f7686 --- /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 0000000000..181c2f0367 --- /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; + +fn textureDimensions_daf7c0() { + var res : vec2 = 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 0000000000..fe52a14aef --- /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; +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 0000000000..297cde7e06 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..2caf8c1d30 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/dba47c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..54b70a501e --- /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 0000000000..f702afb979 --- /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; + +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 0000000000..4e72a1457b --- /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; +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 0000000000..a5f39b185b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture1D 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 0000000000..46d0e9844f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/dc2dd0.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..fee701f41b --- /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 0000000000..03c58ba7f2 --- /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; + +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 0000000000..abe6f69ace --- /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; +fn textureDimensions_e10157() { + var res: vec2 = 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 0000000000..46f2239de6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..c0a6001c05 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e10157.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..333a4c1c0d --- /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 0000000000..4d62897f06 --- /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; + +fn textureDimensions_e10157() { + var res : vec2 = 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 0000000000..9f27264257 --- /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; +fn textureDimensions_e22247() { + var res: vec3 = 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 0000000000..d62e4c4b59 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..76a891c98b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..818d5e763e --- /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 0000000000..520a4c426e --- /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; + +fn textureDimensions_e22247() { + var res : vec3 = 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 0000000000..fe88bb99ad --- /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; +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 0000000000..77def20415 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture1D 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 0000000000..ee0b851e07 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e93464.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c6da4fffa1 --- /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 0000000000..f017f43a2a --- /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; + +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 0000000000..2ad145c006 --- /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; +fn textureDimensions_e9628c() { + var res: vec2 = 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 0000000000..5272b2dd7b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..5017a2d7bd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9628c.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..64d21e6b7f --- /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 0000000000..25127fe05d --- /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; + +fn textureDimensions_e9628c() { + var res : vec2 = 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 0000000000..0237b9f5a8 --- /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; +fn textureDimensions_e9e96c() { + var res: vec2 = 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 0000000000..efb7f4d6ab --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..394dca6902 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9e96c.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..03ca8d599b --- /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 0000000000..7cafbf8672 --- /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; + +fn textureDimensions_e9e96c() { + var res : vec2 = 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 0000000000..c9413c21e0 --- /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; +fn textureDimensions_e9fe54() { + var res: vec2 = 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 0000000000..c6793f2bdc --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..e1665b7233 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9fe54.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..c9c5d5b612 --- /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 0000000000..cd6f322e0c --- /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; + +fn textureDimensions_e9fe54() { + var res : vec2 = 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 0000000000..92d0fa1717 --- /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; +fn textureDimensions_e9fe58() { + var res: vec2 = 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 0000000000..3a61c1eccb --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..a18dd38180 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/e9fe58.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..da7d41f0cc --- /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 0000000000..7b8176763a --- /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; + +fn textureDimensions_e9fe58() { + var res : vec2 = 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 0000000000..8e328a876f --- /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; +fn textureDimensions_eda4e3() { + var res: vec3 = 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 0000000000..6034d6ec9b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..2290c1df10 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..83a4af6a8e --- /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 0000000000..148c5de9e9 --- /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; + +fn textureDimensions_eda4e3() { + var res : vec3 = 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 0000000000..3273bca9c4 --- /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; +fn textureDimensions_ef5b89() { + var res: vec2 = 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 0000000000..e7ff8585a4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS 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 0000000000..93769a95b2 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/ef5b89.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..dbe51815e6 --- /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 0000000000..dc089a7b62 --- /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; + +fn textureDimensions_ef5b89() { + var res : vec2 = 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 0000000000..f0c45632c1 --- /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; +fn textureDimensions_efc8a4() { + var res: vec3 = 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 0000000000..ed94895f9d --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..35d024c836 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4c2a8d3e83 --- /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 0000000000..88c7e1ea22 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/efc8a4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureDimensions_efc8a4() { + var res : vec3 = 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 0000000000..bda8cbcc21 --- /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; +fn textureDimensions_f1b72b() { + var res: vec2 = 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 0000000000..5d979049f8 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..f77285e0ba --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f1b72b.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a17cf540b2 --- /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 0000000000..e74dca43bc --- /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; + +fn textureDimensions_f1b72b() { + var res : vec2 = 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 0000000000..99025ba454 --- /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; +fn textureDimensions_f507c9() { + var res: vec3 = 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 0000000000..e083f66bdc --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube 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 0000000000..9263173a5b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..4827f1ac9c --- /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 0000000000..98211b780b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureDimensions_f507c9() { + var res : vec3 = 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 0000000000..fe667e8f52 --- /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; +fn textureDimensions_f70326() { + var res: vec3 = 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 0000000000..01c94f254b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray 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 0000000000..17338a724e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..70a5677ef7 --- /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 0000000000..e1de80d71c --- /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; + +fn textureDimensions_f70326() { + var res : vec3 = 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 0000000000..908ea166a5 --- /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; +fn textureDimensions_f7145b() { + var res: vec2 = 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 0000000000..5b964ae2a0 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..260fc18a19 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..a4849426a6 --- /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 0000000000..6da99032bd --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7145b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_f7145b() { + var res : vec2 = 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 0000000000..b1fc576d85 --- /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; +fn textureDimensions_f7aa9e() { + var res: vec2 = 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 0000000000..23a9a6cd9a --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..0ff3c91082 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7aa9e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..8e629d6242 --- /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 0000000000..8f5107004a --- /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; + +fn textureDimensions_f7aa9e() { + var res : vec2 = 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 0000000000..3aafa81294 --- /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; +fn textureDimensions_f7e436() { + var res: vec2 = 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 0000000000..49ca1c1f13 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray 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 0000000000..020b3f1f55 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f7e436.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..75f7e65c51 --- /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 0000000000..5b003c54a4 --- /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; + +fn textureDimensions_f7e436() { + var res : vec2 = 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 0000000000..a434674092 --- /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; +fn textureDimensions_f931c7() { + var res: vec2 = 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 0000000000..611e994b0b --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2D 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 0000000000..204705ebc6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/f931c7.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..726ba5b87a --- /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 0000000000..4253c30ec1 --- /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; + +fn textureDimensions_f931c7() { + var res : vec2 = 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 0000000000..bfe7139b40 --- /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; +fn textureDimensions_fa90e1() { + var res: vec2 = 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 0000000000..f5f998f07f --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..1325749ac6 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fa90e1.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..e52ec7d5c2 --- /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 0000000000..546939fae0 --- /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; + +fn textureDimensions_fa90e1() { + var res : vec2 = 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 0000000000..25ce8976ee --- /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; +fn textureDimensions_fa9859() { + var res: vec2 = 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 0000000000..9808fe7e02 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D 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 0000000000..a5f4fea94e --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3d933f0c3e --- /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 0000000000..dab65210b1 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fa9859.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureDimensions_fa9859() { + var res : vec2 = 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 0000000000..3567a74715 --- /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; +fn textureDimensions_fb5670() { + var res: vec2 = 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 0000000000..f7495262ad --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray 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 0000000000..36ca7808aa --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fb5670.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..3cb08940e2 --- /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 0000000000..fc9f484b6d --- /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; + +fn textureDimensions_fb5670() { + var res : vec2 = 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 0000000000..ce6e8f901e --- /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; +fn textureDimensions_fbbe4d() { + var res: vec3 = 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 0000000000..227e90d957 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D 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 0000000000..b0454dbbfa --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fbbe4d.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..cb79facfdb --- /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 0000000000..1b311d4a7f --- /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; + +fn textureDimensions_fbbe4d() { + var res : vec3 = 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 0000000000..f8ce06e2e9 --- /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; +fn textureDimensions_fcac78() { + var res: vec3 = 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 0000000000..97f637eef4 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture3D 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 0000000000..e2ca28c072 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/fcac78.wgsl.expected.msl @@ -0,0 +1,38 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +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 0000000000..bdb36a804f --- /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 0000000000..9d4ec3404f --- /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; + +fn textureDimensions_fcac78() { + var res : vec3 = textureDimensions(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureDimensions_fcac78(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureDimensions_fcac78(); +} + +[[stage(compute)]] +fn compute_main() { + textureDimensions_fcac78(); +} diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl new file mode 100644 index 0000000000..851d695fb1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_050c33() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_050c33(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_050c33(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_050c33(); +} diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl new file mode 100644 index 0000000000..8ffb8fee5a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_050c33() { + uint4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_050c33(); + return; +} + +void fragment_main() { + textureLoad_050c33(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_050c33(); + return; +} + + +tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_BGB5F4:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl new file mode 100644 index 0000000000..834283463f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_050c33() { + uint4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_050c33(); + return; +} + +fragment void fragment_main() { + textureLoad_050c33(); + return; +} + +kernel void compute_main() { + textureLoad_050c33(); + return; +} + + +tint_YLQCFG.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm new file mode 100644 index 0000000000..a51c3153ca --- /dev/null +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_050c33 "textureLoad_050c33" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_050c33 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_050c33 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_050c33 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_050c33 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl new file mode 100644 index 0000000000..3f9f0d4f7e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/050c33.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_050c33() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_050c33(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_050c33(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_050c33(); +} diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl new file mode 100644 index 0000000000..db79f26bab --- /dev/null +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_072e26() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_072e26(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_072e26(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_072e26(); +} diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl new file mode 100644 index 0000000000..0df5e22490 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_072e26() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_072e26(); + return; +} + +void fragment_main() { + textureLoad_072e26(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_072e26(); + return; +} + + +tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_el2pSF:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl new file mode 100644 index 0000000000..9bee2e90b2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_072e26() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_072e26(); + return; +} + +fragment void fragment_main() { + textureLoad_072e26(); + return; +} + +kernel void compute_main() { + textureLoad_072e26(); + return; +} + + +tint_JrhYNT.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm new file mode 100644 index 0000000000..011351479f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_072e26 "textureLoad_072e26" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_072e26 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_072e26 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_072e26 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_072e26 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl new file mode 100644 index 0000000000..2aa87e5ac1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/072e26.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_072e26() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_072e26(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_072e26(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_072e26(); +} diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl new file mode 100644 index 0000000000..8d8dad3083 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_078bc4() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_078bc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_078bc4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_078bc4(); +} diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl new file mode 100644 index 0000000000..3c7fdbc7d9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_078bc4() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_078bc4(); + return; +} + +void fragment_main() { + textureLoad_078bc4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_078bc4(); + return; +} + + +tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_2mt0JA:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl new file mode 100644 index 0000000000..d5062a1bd0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_078bc4() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_078bc4(); + return; +} + +fragment void fragment_main() { + textureLoad_078bc4(); + return; +} + +kernel void compute_main() { + textureLoad_078bc4(); + return; +} + + +tint_jjAKvY.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm new file mode 100644 index 0000000000..ecf39b1f8e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_078bc4 "textureLoad_078bc4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_078bc4 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_078bc4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_078bc4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_078bc4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl new file mode 100644 index 0000000000..b93303fd49 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/078bc4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_078bc4() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_078bc4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_078bc4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_078bc4(); +} diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl new file mode 100644 index 0000000000..8070e3cda9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_127e12() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_127e12(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_127e12(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_127e12(); +} diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl new file mode 100644 index 0000000000..5683cc9d7b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_127e12() { + uint4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_127e12(); + return; +} + +void fragment_main() { + textureLoad_127e12(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_127e12(); + return; +} + + +tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_E7lo1I:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl new file mode 100644 index 0000000000..a996429178 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_127e12() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_127e12(); + return; +} + +fragment void fragment_main() { + textureLoad_127e12(); + return; +} + +kernel void compute_main() { + textureLoad_127e12(); + return; +} + + +tint_cm9xwP.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm new file mode 100644 index 0000000000..8da1b2fde0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_127e12 "textureLoad_127e12" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_127e12 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %19 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_127e12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_127e12 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_127e12 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl new file mode 100644 index 0000000000..1890d11908 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/127e12.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_127e12() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_127e12(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_127e12(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_127e12(); +} diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl new file mode 100644 index 0000000000..44c713e190 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_1561a7() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1561a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1561a7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1561a7(); +} diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl new file mode 100644 index 0000000000..c571701228 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_1561a7() { + uint4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_1561a7(); + return; +} + +void fragment_main() { + textureLoad_1561a7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_1561a7(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl new file mode 100644 index 0000000000..56f55670d6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_1561a7() { + uint4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_1561a7(); + return; +} + +fragment void fragment_main() { + textureLoad_1561a7(); + return; +} + +kernel void compute_main() { + textureLoad_1561a7(); + return; +} + + +tint_o82pOs.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm new file mode 100644 index 0000000000..aa226e0493 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_1561a7 "textureLoad_1561a7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_1561a7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_1561a7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_1561a7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_1561a7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl new file mode 100644 index 0000000000..85e7bac062 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1561a7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_1561a7() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1561a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1561a7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1561a7(); +} diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl new file mode 100644 index 0000000000..561eea2f15 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +fn textureLoad_19cf87() { + var res: f32 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_19cf87(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_19cf87(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_19cf87(); +} diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl new file mode 100644 index 0000000000..9f700a7c4f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.hlsl @@ -0,0 +1,51 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_19cf87() { + float res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_19cf87(); + return; +} + +void fragment_main() { + textureLoad_19cf87(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_19cf87(); + return; +} + + +tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.Load(int3(0), 1); + ^ +tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Load(int3(0), 1); + ^ + + +tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.Load(int3(0), 1); + ^ +tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Load(int3(0), 1); + ^ + + +tint_ZX1vzT:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.Load(int3(0), 1); + ^ +tint_ZX1vzT:4:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl new file mode 100644 index 0000000000..94d4866ba1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_19cf87() { + float res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_19cf87(); + return; +} + +fragment void fragment_main() { + textureLoad_19cf87(); + return; +} + +kernel void compute_main() { + textureLoad_19cf87(); + return; +} + + +tint_AKv56M.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm new file mode 100644 index 0000000000..08cba67b1a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_19cf87 "textureLoad_19cf87" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureLoad_19cf87 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4float %15 %18 Lod %int_1 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_19cf87 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_19cf87 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_19cf87 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl new file mode 100644 index 0000000000..6170911cd2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/19cf87.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +fn textureLoad_19cf87() { + var res : f32 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_19cf87(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_19cf87(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_19cf87(); +} diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl new file mode 100644 index 0000000000..4d030e7663 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_1a062f() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1a062f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1a062f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1a062f(); +} diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl new file mode 100644 index 0000000000..61e5ce94a8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_1a062f() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_1a062f(); + return; +} + +void fragment_main() { + textureLoad_1a062f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_1a062f(); + return; +} + + +tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_ONx53X:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl new file mode 100644 index 0000000000..bb6c46bd7a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_1a062f() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_1a062f(); + return; +} + +fragment void fragment_main() { + textureLoad_1a062f(); + return; +} + +kernel void compute_main() { + textureLoad_1a062f(); + return; +} + + +tint_vRBu5V.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a980105cd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_1a062f "textureLoad_1a062f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_1a062f = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_1a062f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_1a062f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_1a062f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl new file mode 100644 index 0000000000..81a3f1fda3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a062f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_1a062f() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1a062f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1a062f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1a062f(); +} diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl new file mode 100644 index 0000000000..33f2e74ebe --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_1a8452() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1a8452(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1a8452(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1a8452(); +} diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl new file mode 100644 index 0000000000..ca566ee72a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_1a8452() { + uint4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_1a8452(); + return; +} + +void fragment_main() { + textureLoad_1a8452(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_1a8452(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl new file mode 100644 index 0000000000..6ecab82ce5 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_1a8452() { + uint4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_1a8452(); + return; +} + +fragment void fragment_main() { + textureLoad_1a8452(); + return; +} + +kernel void compute_main() { + textureLoad_1a8452(); + return; +} + + +tint_E0YZXD.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm new file mode 100644 index 0000000000..33cabbbd24 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_1a8452 "textureLoad_1a8452" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_1a8452 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_1a8452 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_1a8452 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_1a8452 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl new file mode 100644 index 0000000000..ac00f2b31a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1a8452.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_1a8452() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1a8452(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1a8452(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1a8452(); +} diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl new file mode 100644 index 0000000000..9f9aa3c14e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_1d; +fn textureLoad_1b8588() { + var res: vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1b8588(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1b8588(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1b8588(); +} diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl new file mode 100644 index 0000000000..2839532ab6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_1b8588() { + uint4 res = arg_0.Load(int2(1, 0), 1); +} + +void vertex_main() { + textureLoad_1b8588(); + return; +} + +void fragment_main() { + textureLoad_1b8588(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_1b8588(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl new file mode 100644 index 0000000000..afae3cf954 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_1b8588() { + uint4 res = arg_0.read(1, 1); +} + +vertex void vertex_main() { + textureLoad_1b8588(); + return; +} + +fragment void fragment_main() { + textureLoad_1b8588(); + return; +} + +kernel void compute_main() { + textureLoad_1b8588(); + return; +} + + +tint_8clnPn.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm new file mode 100644 index 0000000000..bbb2eb8800 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Sampled1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_1b8588 "textureLoad_1b8588" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_1b8588 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4uint %15 %int_1 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_1b8588 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_1b8588 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_1b8588 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl new file mode 100644 index 0000000000..643b291b75 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1b8588.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +fn textureLoad_1b8588() { + var res : vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1b8588(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1b8588(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1b8588(); +} diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl new file mode 100644 index 0000000000..9203100006 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureLoad_1f2016() { + var res: vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1f2016(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1f2016(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1f2016(); +} diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl new file mode 100644 index 0000000000..e6296a1ddf --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_1f2016() { + float4 res = arg_0.Load(int4(0), 1); +} + +void vertex_main() { + textureLoad_1f2016(); + return; +} + +void fragment_main() { + textureLoad_1f2016(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_1f2016(); + return; +} + + +tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_jDpZEi:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl new file mode 100644 index 0000000000..a1422f8183 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_1f2016() { + float4 res = arg_0.read(int3(), 1); +} + +vertex void vertex_main() { + textureLoad_1f2016(); + return; +} + +fragment void fragment_main() { + textureLoad_1f2016(); + return; +} + +kernel void compute_main() { + textureLoad_1f2016(); + return; +} + + +tint_PZhzf3.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm new file mode 100644 index 0000000000..e619f07599 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_1f2016 "textureLoad_1f2016" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_1f2016 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %17 Lod %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_1f2016 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_1f2016 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_1f2016 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl new file mode 100644 index 0000000000..94202f9d50 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/1f2016.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureLoad_1f2016() { + var res : vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_1f2016(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_1f2016(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_1f2016(); +} diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl new file mode 100644 index 0000000000..3ea6735268 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_20fa2f() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_20fa2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_20fa2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_20fa2f(); +} diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl new file mode 100644 index 0000000000..62fc6aa873 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_20fa2f() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_20fa2f(); + return; +} + +void fragment_main() { + textureLoad_20fa2f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_20fa2f(); + return; +} + + +tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_yeLScq:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl new file mode 100644 index 0000000000..fecc8ce4b0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_20fa2f() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_20fa2f(); + return; +} + +fragment void fragment_main() { + textureLoad_20fa2f(); + return; +} + +kernel void compute_main() { + textureLoad_20fa2f(); + return; +} + + +tint_laj3aH.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm new file mode 100644 index 0000000000..ae7ed4ad9d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_20fa2f "textureLoad_20fa2f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_20fa2f = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_20fa2f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_20fa2f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_20fa2f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl new file mode 100644 index 0000000000..ef0765a76f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/20fa2f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_20fa2f() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_20fa2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_20fa2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_20fa2f(); +} diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl new file mode 100644 index 0000000000..8a841e7f6b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_276a2c() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_276a2c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_276a2c(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_276a2c(); +} diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl new file mode 100644 index 0000000000..1e7103a351 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_276a2c() { + uint4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_276a2c(); + return; +} + +void fragment_main() { + textureLoad_276a2c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_276a2c(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl new file mode 100644 index 0000000000..763246745c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_276a2c() { + uint4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_276a2c(); + return; +} + +fragment void fragment_main() { + textureLoad_276a2c(); + return; +} + +kernel void compute_main() { + textureLoad_276a2c(); + return; +} + + +tint_d2GdWr.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm new file mode 100644 index 0000000000..fa976935aa --- /dev/null +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_276a2c "textureLoad_276a2c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_276a2c = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_276a2c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_276a2c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_276a2c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl new file mode 100644 index 0000000000..b8110cd051 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/276a2c.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_276a2c() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_276a2c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_276a2c(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_276a2c(); +} diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl new file mode 100644 index 0000000000..1f2018cd06 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_2887d7() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2887d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2887d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2887d7(); +} diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl new file mode 100644 index 0000000000..b3b3d1e11c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_2887d7() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_2887d7(); + return; +} + +void fragment_main() { + textureLoad_2887d7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_2887d7(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl new file mode 100644 index 0000000000..452af57ca2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_2887d7() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_2887d7(); + return; +} + +fragment void fragment_main() { + textureLoad_2887d7(); + return; +} + +kernel void compute_main() { + textureLoad_2887d7(); + return; +} + + +tint_Woie28.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm new file mode 100644 index 0000000000..8a626fda5c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_2887d7 "textureLoad_2887d7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_2887d7 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_2887d7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_2887d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_2887d7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl new file mode 100644 index 0000000000..fdcb0fdb8a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2887d7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_2887d7() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2887d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2887d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2887d7(); +} diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl new file mode 100644 index 0000000000..6f9958fdc3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_2ae485() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2ae485(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2ae485(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2ae485(); +} diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl new file mode 100644 index 0000000000..469640f3fd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_2ae485() { + int4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_2ae485(); + return; +} + +void fragment_main() { + textureLoad_2ae485(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_2ae485(); + return; +} + + +tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_I3bEM0:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl new file mode 100644 index 0000000000..3844142fcd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_2ae485() { + int4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_2ae485(); + return; +} + +fragment void fragment_main() { + textureLoad_2ae485(); + return; +} + +kernel void compute_main() { + textureLoad_2ae485(); + return; +} + + +tint_bpTyQu.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm new file mode 100644 index 0000000000..017de96d41 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_2ae485 "textureLoad_2ae485" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_2ae485 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_2ae485 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_2ae485 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_2ae485 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl new file mode 100644 index 0000000000..c15430ec5d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2ae485.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_2ae485() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2ae485(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2ae485(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2ae485(); +} diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl new file mode 100644 index 0000000000..c04b9f55a2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_2d6cf7() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2d6cf7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2d6cf7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2d6cf7(); +} diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl new file mode 100644 index 0000000000..b747bda73f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_2d6cf7() { + int4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_2d6cf7(); + return; +} + +void fragment_main() { + textureLoad_2d6cf7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_2d6cf7(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl new file mode 100644 index 0000000000..9395679cde --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_2d6cf7() { + int4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_2d6cf7(); + return; +} + +fragment void fragment_main() { + textureLoad_2d6cf7(); + return; +} + +kernel void compute_main() { + textureLoad_2d6cf7(); + return; +} + + +tint_UsuKLT.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm new file mode 100644 index 0000000000..dc721143ef --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_2d6cf7 "textureLoad_2d6cf7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_2d6cf7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_2d6cf7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_2d6cf7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_2d6cf7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl new file mode 100644 index 0000000000..1ada16934b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/2d6cf7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_2d6cf7() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_2d6cf7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_2d6cf7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_2d6cf7(); +} diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl new file mode 100644 index 0000000000..eccc28c8df --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_3c0d9e() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3c0d9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3c0d9e(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3c0d9e(); +} diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl new file mode 100644 index 0000000000..4c4475b50e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_3c0d9e() { + uint4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_3c0d9e(); + return; +} + +void fragment_main() { + textureLoad_3c0d9e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_3c0d9e(); + return; +} + + +tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_nGEaN9:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl new file mode 100644 index 0000000000..89d32a1599 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_3c0d9e() { + uint4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_3c0d9e(); + return; +} + +fragment void fragment_main() { + textureLoad_3c0d9e(); + return; +} + +kernel void compute_main() { + textureLoad_3c0d9e(); + return; +} + + +tint_RbcsGC.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm new file mode 100644 index 0000000000..0dee741e4c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_3c0d9e "textureLoad_3c0d9e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_3c0d9e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_3c0d9e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_3c0d9e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_3c0d9e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl new file mode 100644 index 0000000000..36608fe9a1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c0d9e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_3c0d9e() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3c0d9e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3c0d9e(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3c0d9e(); +} diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl new file mode 100644 index 0000000000..9d4616b5c7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_3c9587() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3c9587(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3c9587(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3c9587(); +} diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl new file mode 100644 index 0000000000..9670a67f9f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_3c9587() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_3c9587(); + return; +} + +void fragment_main() { + textureLoad_3c9587(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_3c9587(); + return; +} + + +tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_NY3dUf:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl new file mode 100644 index 0000000000..60712e66c0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_3c9587() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_3c9587(); + return; +} + +fragment void fragment_main() { + textureLoad_3c9587(); + return; +} + +kernel void compute_main() { + textureLoad_3c9587(); + return; +} + + +tint_LgFWEE.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm new file mode 100644 index 0000000000..a2090115ed --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_3c9587 "textureLoad_3c9587" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_3c9587 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_3c9587 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_3c9587 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_3c9587 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl new file mode 100644 index 0000000000..887771f560 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3c9587.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_3c9587() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3c9587(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3c9587(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3c9587(); +} diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl new file mode 100644 index 0000000000..5c663cde82 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_3d001b() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3d001b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3d001b(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3d001b(); +} diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl new file mode 100644 index 0000000000..5672bad368 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_3d001b() { + int4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_3d001b(); + return; +} + +void fragment_main() { + textureLoad_3d001b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_3d001b(); + return; +} + + +tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_7HF8Og:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl new file mode 100644 index 0000000000..d55d6ac507 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_3d001b() { + int4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_3d001b(); + return; +} + +fragment void fragment_main() { + textureLoad_3d001b(); + return; +} + +kernel void compute_main() { + textureLoad_3d001b(); + return; +} + + +tint_OhK8qo.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm new file mode 100644 index 0000000000..61dba8ee16 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_3d001b "textureLoad_3d001b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_3d001b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_3d001b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_3d001b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_3d001b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl new file mode 100644 index 0000000000..3ef3d15963 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d001b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_3d001b() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3d001b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3d001b(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3d001b(); +} diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl new file mode 100644 index 0000000000..09e6edeaca --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_3d9c90() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3d9c90(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3d9c90(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3d9c90(); +} diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl new file mode 100644 index 0000000000..23429ff7d5 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_3d9c90() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_3d9c90(); + return; +} + +void fragment_main() { + textureLoad_3d9c90(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_3d9c90(); + return; +} + + +tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_DNXias:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl new file mode 100644 index 0000000000..737e62688e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_3d9c90() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_3d9c90(); + return; +} + +fragment void fragment_main() { + textureLoad_3d9c90(); + return; +} + +kernel void compute_main() { + textureLoad_3d9c90(); + return; +} + + +tint_jsl4ld.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm new file mode 100644 index 0000000000..b41a43305d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_3d9c90 "textureLoad_3d9c90" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_3d9c90 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_3d9c90 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_3d9c90 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_3d9c90 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl new file mode 100644 index 0000000000..546b4dce36 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/3d9c90.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_3d9c90() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_3d9c90(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_3d9c90(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_3d9c90(); +} diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl new file mode 100644 index 0000000000..941c5c1e06 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/484344.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureLoad_484344() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_484344(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_484344(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_484344(); +} diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl new file mode 100644 index 0000000000..37936dc16f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_484344() { + float4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_484344(); + return; +} + +void fragment_main() { + textureLoad_484344(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_484344(); + return; +} + + +tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_UQRhQC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl new file mode 100644 index 0000000000..9d40169275 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_484344() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_484344(); + return; +} + +fragment void fragment_main() { + textureLoad_484344(); + return; +} + +kernel void compute_main() { + textureLoad_484344(); + return; +} + + +tint_kMAwof.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm new file mode 100644 index 0000000000..083475d27a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_484344 "textureLoad_484344" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_484344 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %17 Lod %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_484344 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_484344 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_484344 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl new file mode 100644 index 0000000000..8776b0a488 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/484344.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureLoad_484344() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_484344(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_484344(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_484344(); +} diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl new file mode 100644 index 0000000000..747d2ad8fa --- /dev/null +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureLoad_4fd803() { + var res: vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_4fd803(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_4fd803(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_4fd803(); +} diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl new file mode 100644 index 0000000000..83cfe48dc0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_4fd803() { + int4 res = arg_0.Load(int4(0), 1); +} + +void vertex_main() { + textureLoad_4fd803(); + return; +} + +void fragment_main() { + textureLoad_4fd803(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_4fd803(); + return; +} + + +tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_njXxtO:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl new file mode 100644 index 0000000000..3d1c4ce647 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_4fd803() { + int4 res = arg_0.read(int3(), 1); +} + +vertex void vertex_main() { + textureLoad_4fd803(); + return; +} + +fragment void fragment_main() { + textureLoad_4fd803(); + return; +} + +kernel void compute_main() { + textureLoad_4fd803(); + return; +} + + +tint_LFK7PX.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm new file mode 100644 index 0000000000..8ca0c65438 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_4fd803 "textureLoad_4fd803" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_4fd803 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4int %15 %17 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_4fd803 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_4fd803 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_4fd803 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl new file mode 100644 index 0000000000..6bea105443 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/4fd803.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureLoad_4fd803() { + var res : vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_4fd803(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_4fd803(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_4fd803(); +} diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl new file mode 100644 index 0000000000..476e534c5a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_505aa2() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_505aa2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_505aa2(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_505aa2(); +} diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl new file mode 100644 index 0000000000..a15566d5f8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_505aa2() { + int4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_505aa2(); + return; +} + +void fragment_main() { + textureLoad_505aa2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_505aa2(); + return; +} + + +tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_sHFgpf:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl new file mode 100644 index 0000000000..afbf77baaa --- /dev/null +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_505aa2() { + int4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_505aa2(); + return; +} + +fragment void fragment_main() { + textureLoad_505aa2(); + return; +} + +kernel void compute_main() { + textureLoad_505aa2(); + return; +} + + +tint_B775lh.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm new file mode 100644 index 0000000000..799937e0db --- /dev/null +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_505aa2 "textureLoad_505aa2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_505aa2 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_505aa2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_505aa2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_505aa2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl new file mode 100644 index 0000000000..380f1f9e1d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/505aa2.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_505aa2() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_505aa2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_505aa2(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_505aa2(); +} diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl new file mode 100644 index 0000000000..018941a748 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_519ab5() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_519ab5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_519ab5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_519ab5(); +} diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl new file mode 100644 index 0000000000..2a8f26b15a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_519ab5() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_519ab5(); + return; +} + +void fragment_main() { + textureLoad_519ab5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_519ab5(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl new file mode 100644 index 0000000000..e9a10b558a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_519ab5() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_519ab5(); + return; +} + +fragment void fragment_main() { + textureLoad_519ab5(); + return; +} + +kernel void compute_main() { + textureLoad_519ab5(); + return; +} + + +tint_ApSVcX.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm new file mode 100644 index 0000000000..6afde5058f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_519ab5 "textureLoad_519ab5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_519ab5 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_519ab5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_519ab5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_519ab5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl new file mode 100644 index 0000000000..2135d0d24d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/519ab5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_519ab5() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_519ab5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_519ab5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_519ab5(); +} diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl new file mode 100644 index 0000000000..7b226353ad --- /dev/null +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_53378a() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_53378a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_53378a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_53378a(); +} diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl new file mode 100644 index 0000000000..23334b1e8c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_53378a() { + int4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_53378a(); + return; +} + +void fragment_main() { + textureLoad_53378a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_53378a(); + return; +} + + +tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_OBikHu:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl new file mode 100644 index 0000000000..6014dee21c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_53378a() { + int4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_53378a(); + return; +} + +fragment void fragment_main() { + textureLoad_53378a(); + return; +} + +kernel void compute_main() { + textureLoad_53378a(); + return; +} + + +tint_xZcA0b.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm new file mode 100644 index 0000000000..b916b86fd7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_53378a "textureLoad_53378a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_53378a = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_53378a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_53378a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_53378a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl new file mode 100644 index 0000000000..0310fa33ea --- /dev/null +++ b/test/intrinsics/gen/textureLoad/53378a.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_53378a() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_53378a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_53378a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_53378a(); +} diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl new file mode 100644 index 0000000000..172dccdb14 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/560573.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_560573() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_560573(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_560573(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_560573(); +} diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl new file mode 100644 index 0000000000..1e7d2fb546 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_560573() { + int4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_560573(); + return; +} + +void fragment_main() { + textureLoad_560573(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_560573(); + return; +} + + +tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_VTctXI:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl new file mode 100644 index 0000000000..0eb867438c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_560573() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_560573(); + return; +} + +fragment void fragment_main() { + textureLoad_560573(); + return; +} + +kernel void compute_main() { + textureLoad_560573(); + return; +} + + +tint_cktG5W.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm new file mode 100644 index 0000000000..c8598fbde9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_560573 "textureLoad_560573" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_560573 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_560573 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_560573 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_560573 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl new file mode 100644 index 0000000000..3a6f48e001 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/560573.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_560573() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_560573(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_560573(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_560573(); +} diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl new file mode 100644 index 0000000000..07d3370253 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/582015.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_582015() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_582015(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_582015(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_582015(); +} diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl new file mode 100644 index 0000000000..a9bb48799c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_582015() { + int4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_582015(); + return; +} + +void fragment_main() { + textureLoad_582015(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_582015(); + return; +} + + +tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_zwnAkS:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl new file mode 100644 index 0000000000..b64322d4a0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_582015() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_582015(); + return; +} + +fragment void fragment_main() { + textureLoad_582015(); + return; +} + +kernel void compute_main() { + textureLoad_582015(); + return; +} + + +tint_qpBH7K.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm new file mode 100644 index 0000000000..8fe91009b1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_582015 "textureLoad_582015" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_582015 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_582015 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_582015 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_582015 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl new file mode 100644 index 0000000000..21b62375ba --- /dev/null +++ b/test/intrinsics/gen/textureLoad/582015.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_582015() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_582015(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_582015(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_582015(); +} diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl new file mode 100644 index 0000000000..1b876abe83 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_1d; +fn textureLoad_5a2f9d() { + var res: vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5a2f9d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5a2f9d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5a2f9d(); +} diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl new file mode 100644 index 0000000000..2d4ad36a30 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_5a2f9d() { + int4 res = arg_0.Load(int2(1, 0), 1); +} + +void vertex_main() { + textureLoad_5a2f9d(); + return; +} + +void fragment_main() { + textureLoad_5a2f9d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_5a2f9d(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl new file mode 100644 index 0000000000..6ed398fad0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_5a2f9d() { + int4 res = arg_0.read(1, 1); +} + +vertex void vertex_main() { + textureLoad_5a2f9d(); + return; +} + +fragment void fragment_main() { + textureLoad_5a2f9d(); + return; +} + +kernel void compute_main() { + textureLoad_5a2f9d(); + return; +} + + +tint_CRtFdW.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm new file mode 100644 index 0000000000..82ae564813 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Sampled1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_5a2f9d "textureLoad_5a2f9d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_5a2f9d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4int %15 %int_1 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_5a2f9d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_5a2f9d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_5a2f9d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl new file mode 100644 index 0000000000..22da997482 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5a2f9d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +fn textureLoad_5a2f9d() { + var res : vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5a2f9d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5a2f9d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5a2f9d(); +} diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl new file mode 100644 index 0000000000..a698444034 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_5bb7fb() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5bb7fb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5bb7fb(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5bb7fb(); +} diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl new file mode 100644 index 0000000000..82ce725c7b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_5bb7fb() { + uint4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_5bb7fb(); + return; +} + +void fragment_main() { + textureLoad_5bb7fb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_5bb7fb(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl new file mode 100644 index 0000000000..b0e3ec01a6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_5bb7fb() { + uint4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_5bb7fb(); + return; +} + +fragment void fragment_main() { + textureLoad_5bb7fb(); + return; +} + +kernel void compute_main() { + textureLoad_5bb7fb(); + return; +} + + +tint_7znWmf.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm new file mode 100644 index 0000000000..e82fd45ebc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_5bb7fb "textureLoad_5bb7fb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_5bb7fb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_5bb7fb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_5bb7fb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_5bb7fb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl new file mode 100644 index 0000000000..9336c2d7fc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5bb7fb.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_5bb7fb() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5bb7fb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5bb7fb(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5bb7fb(); +} diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl new file mode 100644 index 0000000000..605696e7a3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_5d0a2f() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5d0a2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5d0a2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5d0a2f(); +} diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl new file mode 100644 index 0000000000..28e043887f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_5d0a2f() { + uint4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_5d0a2f(); + return; +} + +void fragment_main() { + textureLoad_5d0a2f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_5d0a2f(); + return; +} + + +tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_6yX9g1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl new file mode 100644 index 0000000000..8b917290ee --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_5d0a2f() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_5d0a2f(); + return; +} + +fragment void fragment_main() { + textureLoad_5d0a2f(); + return; +} + +kernel void compute_main() { + textureLoad_5d0a2f(); + return; +} + + +tint_hkcUe3.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm new file mode 100644 index 0000000000..6bf1faacdd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_5d0a2f "textureLoad_5d0a2f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_5d0a2f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %19 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_5d0a2f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_5d0a2f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_5d0a2f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl new file mode 100644 index 0000000000..57d879a33f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/5d0a2f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_5d0a2f() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_5d0a2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_5d0a2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_5d0a2f(); +} diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl new file mode 100644 index 0000000000..4cffca10a3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureLoad_6154d4() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_6154d4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_6154d4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_6154d4(); +} diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl new file mode 100644 index 0000000000..564248191c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_6154d4() { + uint4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_6154d4(); + return; +} + +void fragment_main() { + textureLoad_6154d4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_6154d4(); + return; +} + + +tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_QZYT9D:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl new file mode 100644 index 0000000000..2adcb35c52 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_6154d4() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_6154d4(); + return; +} + +fragment void fragment_main() { + textureLoad_6154d4(); + return; +} + +kernel void compute_main() { + textureLoad_6154d4(); + return; +} + + +tint_i3aA5Y.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm new file mode 100644 index 0000000000..c9b3a24090 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_6154d4 "textureLoad_6154d4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_6154d4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4uint %15 %18 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_6154d4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_6154d4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_6154d4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl new file mode 100644 index 0000000000..21aa49a5a8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6154d4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureLoad_6154d4() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_6154d4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_6154d4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_6154d4(); +} diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl new file mode 100644 index 0000000000..c3e1ed0b34 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_62d125() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_62d125(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_62d125(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_62d125(); +} diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl new file mode 100644 index 0000000000..9a9a6cf349 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_62d125() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_62d125(); + return; +} + +void fragment_main() { + textureLoad_62d125(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_62d125(); + return; +} + + +tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_Q3PltH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl new file mode 100644 index 0000000000..9e5a3c159a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_62d125() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_62d125(); + return; +} + +fragment void fragment_main() { + textureLoad_62d125(); + return; +} + +kernel void compute_main() { + textureLoad_62d125(); + return; +} + + +tint_7Etnvc.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm new file mode 100644 index 0000000000..34ab6f8678 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_62d125 "textureLoad_62d125" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_62d125 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_62d125 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_62d125 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_62d125 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl new file mode 100644 index 0000000000..1035db6995 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/62d125.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_62d125() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_62d125(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_62d125(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_62d125(); +} diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl new file mode 100644 index 0000000000..d862939b90 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_6678b6() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_6678b6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_6678b6(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_6678b6(); +} diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl new file mode 100644 index 0000000000..c412e7caf1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_6678b6() { + int4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_6678b6(); + return; +} + +void fragment_main() { + textureLoad_6678b6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_6678b6(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl new file mode 100644 index 0000000000..cbfb396ac6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_6678b6() { + int4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_6678b6(); + return; +} + +fragment void fragment_main() { + textureLoad_6678b6(); + return; +} + +kernel void compute_main() { + textureLoad_6678b6(); + return; +} + + +tint_jYZ5PL.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm new file mode 100644 index 0000000000..d0098edeaf --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_6678b6 "textureLoad_6678b6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_6678b6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_6678b6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_6678b6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_6678b6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl new file mode 100644 index 0000000000..65efde1f43 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/6678b6.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_6678b6() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_6678b6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_6678b6(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_6678b6(); +} diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl new file mode 100644 index 0000000000..934f63268f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_67edca() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_67edca(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_67edca(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_67edca(); +} diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl new file mode 100644 index 0000000000..709ab8342d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_67edca() { + uint4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_67edca(); + return; +} + +void fragment_main() { + textureLoad_67edca(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_67edca(); + return; +} + + +tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_YIVt97:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl new file mode 100644 index 0000000000..ead27c9475 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_67edca() { + uint4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_67edca(); + return; +} + +fragment void fragment_main() { + textureLoad_67edca(); + return; +} + +kernel void compute_main() { + textureLoad_67edca(); + return; +} + + +tint_6fwyP5.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm new file mode 100644 index 0000000000..5e131820fc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_67edca "textureLoad_67edca" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_67edca = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_67edca + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_67edca + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_67edca + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl new file mode 100644 index 0000000000..48f60e91ef --- /dev/null +++ b/test/intrinsics/gen/textureLoad/67edca.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_67edca() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_67edca(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_67edca(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_67edca(); +} diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl new file mode 100644 index 0000000000..ecb0e5ce02 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/749704.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_749704() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_749704(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_749704(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_749704(); +} diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl new file mode 100644 index 0000000000..2c3d94659b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_749704() { + uint4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_749704(); + return; +} + +void fragment_main() { + textureLoad_749704(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_749704(); + return; +} + + +tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_Jwx5mi:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl new file mode 100644 index 0000000000..ef756da3be --- /dev/null +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_749704() { + uint4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_749704(); + return; +} + +fragment void fragment_main() { + textureLoad_749704(); + return; +} + +kernel void compute_main() { + textureLoad_749704(); + return; +} + + +tint_h41DHl.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm new file mode 100644 index 0000000000..9826b952d3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_749704 "textureLoad_749704" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_749704 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_749704 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_749704 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_749704 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl new file mode 100644 index 0000000000..ac72def213 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/749704.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_749704() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_749704(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_749704(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_749704(); +} diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl new file mode 100644 index 0000000000..2beff2a1a6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureLoad_79e697() { + var res: vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_79e697(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_79e697(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_79e697(); +} diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl new file mode 100644 index 0000000000..1cddd6c383 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_79e697() { + int4 res = arg_0.Load(int4(1, 0), 1); +} + +void vertex_main() { + textureLoad_79e697(); + return; +} + +void fragment_main() { + textureLoad_79e697(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_79e697(); + return; +} + + +tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_P9Drzs:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl new file mode 100644 index 0000000000..a592ca735f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_79e697() { + int4 res = arg_0.read(int2(), 1, 1); +} + +vertex void vertex_main() { + textureLoad_79e697(); + return; +} + +fragment void fragment_main() { + textureLoad_79e697(); + return; +} + +kernel void compute_main() { + textureLoad_79e697(); + return; +} + + +tint_0CahWp.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm new file mode 100644 index 0000000000..5d05eba145 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.spvasm @@ -0,0 +1,71 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_79e697 "textureLoad_79e697" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_79e697 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4int %15 %18 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_79e697 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_79e697 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_79e697 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl new file mode 100644 index 0000000000..f22e4e2644 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/79e697.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureLoad_79e697() { + var res : vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_79e697(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_79e697(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_79e697(); +} diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl new file mode 100644 index 0000000000..c45502f92a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureLoad_7c90e5() { + var res: vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_7c90e5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_7c90e5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_7c90e5(); +} diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl new file mode 100644 index 0000000000..de8c82e113 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_7c90e5() { + uint4 res = arg_0.Load(int4(1, 0), 1); +} + +void vertex_main() { + textureLoad_7c90e5(); + return; +} + +void fragment_main() { + textureLoad_7c90e5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_7c90e5(); + return; +} + + +tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_BFevEy:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl new file mode 100644 index 0000000000..add45a9ff9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_7c90e5() { + uint4 res = arg_0.read(int2(), 1, 1); +} + +vertex void vertex_main() { + textureLoad_7c90e5(); + return; +} + +fragment void fragment_main() { + textureLoad_7c90e5(); + return; +} + +kernel void compute_main() { + textureLoad_7c90e5(); + return; +} + + +tint_cSpOsM.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm new file mode 100644 index 0000000000..34462667a8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_7c90e5 "textureLoad_7c90e5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_7c90e5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4uint %15 %19 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_7c90e5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_7c90e5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_7c90e5 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl new file mode 100644 index 0000000000..e5ebce3269 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/7c90e5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureLoad_7c90e5() { + var res : vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_7c90e5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_7c90e5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_7c90e5(); +} diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl new file mode 100644 index 0000000000..8d1b0cb36f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_1d; +fn textureLoad_81c381() { + var res: vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_81c381(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_81c381(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_81c381(); +} diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl new file mode 100644 index 0000000000..fdca8d18d8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_81c381() { + float4 res = arg_0.Load(int2(1, 0), 1); +} + +void vertex_main() { + textureLoad_81c381(); + return; +} + +void fragment_main() { + textureLoad_81c381(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_81c381(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl new file mode 100644 index 0000000000..b244c3a1df --- /dev/null +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_81c381() { + float4 res = arg_0.read(1, 1); +} + +vertex void vertex_main() { + textureLoad_81c381(); + return; +} + +fragment void fragment_main() { + textureLoad_81c381(); + return; +} + +kernel void compute_main() { + textureLoad_81c381(); + return; +} + + +tint_w456fy.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm new file mode 100644 index 0000000000..b5702bba99 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Sampled1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_81c381 "textureLoad_81c381" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_81c381 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %int_1 Lod %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_81c381 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_81c381 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_81c381 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl new file mode 100644 index 0000000000..458368bdbe --- /dev/null +++ b/test/intrinsics/gen/textureLoad/81c381.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +fn textureLoad_81c381() { + var res : vec4 = textureLoad(arg_0, 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_81c381(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_81c381(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_81c381(); +} diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl new file mode 100644 index 0000000000..097007a62a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_83cea4() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_83cea4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_83cea4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_83cea4(); +} diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl new file mode 100644 index 0000000000..decc049b86 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_83cea4() { + uint4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_83cea4(); + return; +} + +void fragment_main() { + textureLoad_83cea4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_83cea4(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl new file mode 100644 index 0000000000..59a2bca6e8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_83cea4() { + uint4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_83cea4(); + return; +} + +fragment void fragment_main() { + textureLoad_83cea4(); + return; +} + +kernel void compute_main() { + textureLoad_83cea4(); + return; +} + + +tint_7kpW9b.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm new file mode 100644 index 0000000000..73bb99c614 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_83cea4 "textureLoad_83cea4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_83cea4 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_83cea4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_83cea4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_83cea4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl new file mode 100644 index 0000000000..04820c2a2f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/83cea4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_83cea4() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_83cea4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_83cea4(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_83cea4(); +} diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl new file mode 100644 index 0000000000..0ce5ed9cf4 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureLoad_87be85() { + var res: vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_87be85(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_87be85(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_87be85(); +} diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl new file mode 100644 index 0000000000..477020c5cf --- /dev/null +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_87be85() { + float4 res = arg_0.Load(int4(1, 0), 1); +} + +void vertex_main() { + textureLoad_87be85(); + return; +} + +void fragment_main() { + textureLoad_87be85(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_87be85(); + return; +} + + +tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_vATPFA:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl new file mode 100644 index 0000000000..ea046202e3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_87be85() { + float4 res = arg_0.read(int2(), 1, 1); +} + +vertex void vertex_main() { + textureLoad_87be85(); + return; +} + +fragment void fragment_main() { + textureLoad_87be85(); + return; +} + +kernel void compute_main() { + textureLoad_87be85(); + return; +} + + +tint_8RPPdu.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm new file mode 100644 index 0000000000..66cb0c8582 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.spvasm @@ -0,0 +1,71 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_87be85 "textureLoad_87be85" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_87be85 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %18 Lod %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_87be85 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_87be85 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_87be85 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl new file mode 100644 index 0000000000..5029fffbf2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/87be85.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureLoad_87be85() { + var res : vec4 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_87be85(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_87be85(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_87be85(); +} diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl new file mode 100644 index 0000000000..f5e787e0ad --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_external; +fn textureLoad_8acf41() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_8acf41(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_8acf41(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_8acf41(); +} diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl new file mode 100644 index 0000000000..dd3ce78ba2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_8acf41() { + float4 res = arg_0.Load(int3(0), 0); +} + +void vertex_main() { + textureLoad_8acf41(); + return; +} + +void fragment_main() { + textureLoad_8acf41(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_8acf41(); + return; +} + + +tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 0); + ^ + + +tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 0); + ^ + + +tint_ZQ8VDM:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 0); + ^ + diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl new file mode 100644 index 0000000000..1419abf976 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_8acf41() { + float4 res = arg_0.read(int2(), 0); +} + +vertex void vertex_main() { + textureLoad_8acf41(); + return; +} + +fragment void fragment_main() { + textureLoad_8acf41(); + return; +} + +kernel void compute_main() { + textureLoad_8acf41(); + return; +} + + +tint_olJAtB.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 0); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm new file mode 100644 index 0000000000..c639aff707 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_8acf41 "textureLoad_8acf41" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %int_0 = OpConstant %int 0 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_8acf41 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %17 Lod %int_0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_8acf41 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_8acf41 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_8acf41 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl new file mode 100644 index 0000000000..fc9278eda2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8acf41.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : external_texture; + +fn textureLoad_8acf41() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_8acf41(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_8acf41(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_8acf41(); +} diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl new file mode 100644 index 0000000000..16885de4d8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_8e5032() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_8e5032(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_8e5032(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_8e5032(); +} diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl new file mode 100644 index 0000000000..5e873e1578 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_8e5032() { + uint4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_8e5032(); + return; +} + +void fragment_main() { + textureLoad_8e5032(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_8e5032(); + return; +} + + +tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_nKMIU1:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl new file mode 100644 index 0000000000..42a75d74df --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_8e5032() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_8e5032(); + return; +} + +fragment void fragment_main() { + textureLoad_8e5032(); + return; +} + +kernel void compute_main() { + textureLoad_8e5032(); + return; +} + + +tint_N2THrH.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm new file mode 100644 index 0000000000..53582a8fe8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.spvasm @@ -0,0 +1,74 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_8e5032 "textureLoad_8e5032" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_8e5032 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %19 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_8e5032 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_8e5032 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_8e5032 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl new file mode 100644 index 0000000000..e3d7995edc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/8e5032.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_8e5032() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_8e5032(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_8e5032(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_8e5032(); +} diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl new file mode 100644 index 0000000000..8354199aed --- /dev/null +++ b/test/intrinsics/gen/textureLoad/936952.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_936952() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_936952(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_936952(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_936952(); +} diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl new file mode 100644 index 0000000000..2009c30a0f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_936952() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_936952(); + return; +} + +void fragment_main() { + textureLoad_936952(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_936952(); + return; +} + + +tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_5agKeg:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl new file mode 100644 index 0000000000..211f973fb7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_936952() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_936952(); + return; +} + +fragment void fragment_main() { + textureLoad_936952(); + return; +} + +kernel void compute_main() { + textureLoad_936952(); + return; +} + + +tint_Cky0g4.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm new file mode 100644 index 0000000000..413f85a6b9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_936952 "textureLoad_936952" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_936952 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_936952 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_936952 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_936952 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl new file mode 100644 index 0000000000..618a8cfaf1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/936952.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_936952() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_936952(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_936952(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_936952(); +} diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl new file mode 100644 index 0000000000..6d893bbef2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_9a7c90() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9a7c90(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9a7c90(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9a7c90(); +} diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl new file mode 100644 index 0000000000..c889dba325 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_9a7c90() { + uint4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_9a7c90(); + return; +} + +void fragment_main() { + textureLoad_9a7c90(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_9a7c90(); + return; +} + + +tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_AO9JZy:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl new file mode 100644 index 0000000000..3e6872e44a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_9a7c90() { + uint4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_9a7c90(); + return; +} + +fragment void fragment_main() { + textureLoad_9a7c90(); + return; +} + +kernel void compute_main() { + textureLoad_9a7c90(); + return; +} + + +tint_UQd2nQ.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm new file mode 100644 index 0000000000..3e11609a43 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_9a7c90 "textureLoad_9a7c90" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_9a7c90 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_9a7c90 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_9a7c90 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_9a7c90 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl new file mode 100644 index 0000000000..99b2bda802 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9a7c90.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_9a7c90() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9a7c90(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9a7c90(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9a7c90(); +} diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl new file mode 100644 index 0000000000..a204e9dd46 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +fn textureLoad_9b2667() { + var res: f32 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9b2667(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9b2667(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9b2667(); +} diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl new file mode 100644 index 0000000000..b94ff9a57a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_9b2667() { + float res = arg_0.Load(int4(1, 0), 1); +} + +void vertex_main() { + textureLoad_9b2667(); + return; +} + +void fragment_main() { + textureLoad_9b2667(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_9b2667(); + return; +} + + +tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + float res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + float res = arg_0.Load(int4(1, 0), 1); + ^ + + +tint_J1cKa6:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + float res = arg_0.Load(int4(1, 0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl new file mode 100644 index 0000000000..9eb5e2408f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_9b2667() { + float res = arg_0.read(int2(), 1, 1); +} + +vertex void vertex_main() { + textureLoad_9b2667(); + return; +} + +fragment void fragment_main() { + textureLoad_9b2667(); + return; +} + +kernel void compute_main() { + textureLoad_9b2667(); + return; +} + + +tint_t9cZ5X.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.read(int2(), 1, 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm new file mode 100644 index 0000000000..e342e2c5c8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.spvasm @@ -0,0 +1,71 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_9b2667 "textureLoad_9b2667" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureLoad_9b2667 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4float %15 %19 Lod %int_1 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_9b2667 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_9b2667 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_9b2667 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl new file mode 100644 index 0000000000..aa5e716e7f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9b2667.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +fn textureLoad_9b2667() { + var res : f32 = textureLoad(arg_0, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9b2667(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9b2667(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9b2667(); +} diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl new file mode 100644 index 0000000000..cf25b4b0c7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_9c2a14() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9c2a14(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9c2a14(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9c2a14(); +} diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl new file mode 100644 index 0000000000..4768d80a19 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_9c2a14() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_9c2a14(); + return; +} + +void fragment_main() { + textureLoad_9c2a14(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_9c2a14(); + return; +} + + +tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_Z4LvLC:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl new file mode 100644 index 0000000000..9fa3c708e7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_9c2a14() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_9c2a14(); + return; +} + +fragment void fragment_main() { + textureLoad_9c2a14(); + return; +} + +kernel void compute_main() { + textureLoad_9c2a14(); + return; +} + + +tint_XqayFJ.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm new file mode 100644 index 0000000000..895e3cdb78 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_9c2a14 "textureLoad_9c2a14" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_9c2a14 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_9c2a14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_9c2a14 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_9c2a14 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl new file mode 100644 index 0000000000..fdd5a28aae --- /dev/null +++ b/test/intrinsics/gen/textureLoad/9c2a14.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_9c2a14() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_9c2a14(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_9c2a14(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_9c2a14(); +} diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl new file mode 100644 index 0000000000..6b503a3130 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureLoad_a583c9() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a583c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a583c9(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a583c9(); +} diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl new file mode 100644 index 0000000000..d0e08b5402 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.hlsl @@ -0,0 +1,51 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DMS arg_0 : register(t0, space1); + +void textureLoad_a583c9() { + float4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_a583c9(); + return; +} + +void fragment_main() { + textureLoad_a583c9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_a583c9(); + return; +} + + +tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ +tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion] + float4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ +tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion] + float4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_0qET7a:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0), 1); + ^ +tint_0qET7a:4:27: warning: implicit truncation of vector type [-Wconversion] + float4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl new file mode 100644 index 0000000000..72ba5fbccd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_a583c9() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_a583c9(); + return; +} + +fragment void fragment_main() { + textureLoad_a583c9(); + return; +} + +kernel void compute_main() { + textureLoad_a583c9(); + return; +} + + +tint_0WA0ve.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm new file mode 100644 index 0000000000..d1d4806646 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_a583c9 "textureLoad_a583c9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_a583c9 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageFetch %v4float %14 %17 Sample %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_a583c9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_a583c9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_a583c9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl new file mode 100644 index 0000000000..0eb7d2fc3e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a583c9.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureLoad_a583c9() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a583c9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a583c9(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a583c9(); +} diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl new file mode 100644 index 0000000000..1c7be46357 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_a6a85a() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a6a85a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a6a85a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a6a85a(); +} diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl new file mode 100644 index 0000000000..18e1fee391 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_a6a85a() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_a6a85a(); + return; +} + +void fragment_main() { + textureLoad_a6a85a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_a6a85a(); + return; +} + + +tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_5T6Aqu:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl new file mode 100644 index 0000000000..81c2d07d54 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_a6a85a() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_a6a85a(); + return; +} + +fragment void fragment_main() { + textureLoad_a6a85a(); + return; +} + +kernel void compute_main() { + textureLoad_a6a85a(); + return; +} + + +tint_MZOSDo.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm new file mode 100644 index 0000000000..43cd94e046 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_a6a85a "textureLoad_a6a85a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_a6a85a = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_a6a85a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_a6a85a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_a6a85a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl new file mode 100644 index 0000000000..89dc933cee --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6a85a.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_a6a85a() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a6a85a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a6a85a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a6a85a(); +} diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl new file mode 100644 index 0000000000..52c4f5ff4a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_a6b61d() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a6b61d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a6b61d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a6b61d(); +} diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl new file mode 100644 index 0000000000..b9d20eda4c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_a6b61d() { + int4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_a6b61d(); + return; +} + +void fragment_main() { + textureLoad_a6b61d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_a6b61d(); + return; +} + + +tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_zy9Rzv:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl new file mode 100644 index 0000000000..741e9d047e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_a6b61d() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_a6b61d(); + return; +} + +fragment void fragment_main() { + textureLoad_a6b61d(); + return; +} + +kernel void compute_main() { + textureLoad_a6b61d(); + return; +} + + +tint_MCK3GD.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm new file mode 100644 index 0000000000..3d2357ae28 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_a6b61d "textureLoad_a6b61d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_a6b61d = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_a6b61d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_a6b61d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_a6b61d + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl new file mode 100644 index 0000000000..a3e63937a8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a6b61d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_a6b61d() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a6b61d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a6b61d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a6b61d(); +} diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl new file mode 100644 index 0000000000..42d9f0b919 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_a7a3c3() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a7a3c3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a7a3c3(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a7a3c3(); +} diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl new file mode 100644 index 0000000000..66f97b3ed5 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_a7a3c3() { + int4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_a7a3c3(); + return; +} + +void fragment_main() { + textureLoad_a7a3c3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_a7a3c3(); + return; +} + + +tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_bip4TJ:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl new file mode 100644 index 0000000000..04e3168c05 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_a7a3c3() { + int4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_a7a3c3(); + return; +} + +fragment void fragment_main() { + textureLoad_a7a3c3(); + return; +} + +kernel void compute_main() { + textureLoad_a7a3c3(); + return; +} + + +tint_rFvCL7.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm new file mode 100644 index 0000000000..b068e66f02 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_a7a3c3 "textureLoad_a7a3c3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_a7a3c3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_a7a3c3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_a7a3c3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_a7a3c3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl new file mode 100644 index 0000000000..d6ad3c5ba3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a7a3c3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_a7a3c3() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a7a3c3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a7a3c3(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a7a3c3(); +} diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl new file mode 100644 index 0000000000..a2861bff21 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureLoad_a9a9f5() { + var res: vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a9a9f5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a9a9f5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a9a9f5(); +} diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl new file mode 100644 index 0000000000..1a77cc199d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_a9a9f5() { + uint4 res = arg_0.Load(int4(0), 1); +} + +void vertex_main() { + textureLoad_a9a9f5(); + return; +} + +void fragment_main() { + textureLoad_a9a9f5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_a9a9f5(); + return; +} + + +tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0), 1); + ^ + + +tint_bOsi23:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl new file mode 100644 index 0000000000..c7341437ed --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_a9a9f5() { + uint4 res = arg_0.read(int3(), 1); +} + +vertex void vertex_main() { + textureLoad_a9a9f5(); + return; +} + +fragment void fragment_main() { + textureLoad_a9a9f5(); + return; +} + +kernel void compute_main() { + textureLoad_a9a9f5(); + return; +} + + +tint_XRA6On.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm new file mode 100644 index 0000000000..83b174d44b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_a9a9f5 "textureLoad_a9a9f5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_a9a9f5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4uint %15 %18 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_a9a9f5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_a9a9f5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_a9a9f5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl new file mode 100644 index 0000000000..5a07216148 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/a9a9f5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureLoad_a9a9f5() { + var res : vec4 = textureLoad(arg_0, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_a9a9f5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_a9a9f5(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_a9a9f5(); +} diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl new file mode 100644 index 0000000000..9bdf7598fa --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_b1bf79() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b1bf79(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b1bf79(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b1bf79(); +} diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl new file mode 100644 index 0000000000..ef7bcdf0af --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_b1bf79() { + int4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_b1bf79(); + return; +} + +void fragment_main() { + textureLoad_b1bf79(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_b1bf79(); + return; +} + + +tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_IIBxye:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl new file mode 100644 index 0000000000..a94e96bcc7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_b1bf79() { + int4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_b1bf79(); + return; +} + +fragment void fragment_main() { + textureLoad_b1bf79(); + return; +} + +kernel void compute_main() { + textureLoad_b1bf79(); + return; +} + + +tint_YXVObw.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm new file mode 100644 index 0000000000..168c98ac80 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_b1bf79 "textureLoad_b1bf79" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_b1bf79 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_b1bf79 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_b1bf79 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_b1bf79 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl new file mode 100644 index 0000000000..c722eb37ce --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b1bf79.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_b1bf79() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b1bf79(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b1bf79(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b1bf79(); +} diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl new file mode 100644 index 0000000000..60239d068e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_b58c6d() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b58c6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b58c6d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b58c6d(); +} diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl new file mode 100644 index 0000000000..5ee358626e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_b58c6d() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_b58c6d(); + return; +} + +void fragment_main() { + textureLoad_b58c6d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_b58c6d(); + return; +} + + +tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_w6a5sI:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl new file mode 100644 index 0000000000..24d5f4951b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_b58c6d() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_b58c6d(); + return; +} + +fragment void fragment_main() { + textureLoad_b58c6d(); + return; +} + +kernel void compute_main() { + textureLoad_b58c6d(); + return; +} + + +tint_l0fo2E.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm new file mode 100644 index 0000000000..666c185aeb --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_b58c6d "textureLoad_b58c6d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_b58c6d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_b58c6d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_b58c6d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_b58c6d + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl new file mode 100644 index 0000000000..4f945bc297 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b58c6d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_b58c6d() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b58c6d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b58c6d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b58c6d(); +} diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl new file mode 100644 index 0000000000..3989081582 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_b6c458() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b6c458(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b6c458(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b6c458(); +} diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl new file mode 100644 index 0000000000..773c1c3310 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_b6c458() { + uint4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_b6c458(); + return; +} + +void fragment_main() { + textureLoad_b6c458(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_b6c458(); + return; +} + + +tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_VnSeLa:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl new file mode 100644 index 0000000000..05acd49bfc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_b6c458() { + uint4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_b6c458(); + return; +} + +fragment void fragment_main() { + textureLoad_b6c458(); + return; +} + +kernel void compute_main() { + textureLoad_b6c458(); + return; +} + + +tint_VddxXh.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm new file mode 100644 index 0000000000..40a4ccb0ef --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_b6c458 "textureLoad_b6c458" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_b6c458 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_b6c458 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_b6c458 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_b6c458 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl new file mode 100644 index 0000000000..317bcc472f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/b6c458.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_b6c458() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_b6c458(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_b6c458(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_b6c458(); +} diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl new file mode 100644 index 0000000000..0ae454d65b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_bfd154() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_bfd154(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_bfd154(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_bfd154(); +} diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl new file mode 100644 index 0000000000..89f908bb79 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_bfd154() { + uint4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_bfd154(); + return; +} + +void fragment_main() { + textureLoad_bfd154(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_bfd154(); + return; +} + + +tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_MeG28m:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl new file mode 100644 index 0000000000..b24fd26e63 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_bfd154() { + uint4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_bfd154(); + return; +} + +fragment void fragment_main() { + textureLoad_bfd154(); + return; +} + +kernel void compute_main() { + textureLoad_bfd154(); + return; +} + + +tint_s46SKh.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm new file mode 100644 index 0000000000..5fe780fd95 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_bfd154 "textureLoad_bfd154" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_bfd154 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_bfd154 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_bfd154 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_bfd154 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl new file mode 100644 index 0000000000..45d2471e66 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/bfd154.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_bfd154() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_bfd154(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_bfd154(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_bfd154(); +} diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl new file mode 100644 index 0000000000..88beec81ad --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_c02b74() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c02b74(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c02b74(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c02b74(); +} diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl new file mode 100644 index 0000000000..0260e3b7c7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_c02b74() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_c02b74(); + return; +} + +void fragment_main() { + textureLoad_c02b74(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c02b74(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl new file mode 100644 index 0000000000..5e004de5dc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c02b74() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_c02b74(); + return; +} + +fragment void fragment_main() { + textureLoad_c02b74(); + return; +} + +kernel void compute_main() { + textureLoad_c02b74(); + return; +} + + +tint_plnP7W.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm new file mode 100644 index 0000000000..79294d52d9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c02b74 "textureLoad_c02b74" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_c02b74 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_c02b74 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_c02b74 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_c02b74 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl new file mode 100644 index 0000000000..82ce81a253 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c02b74.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_c02b74() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c02b74(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c02b74(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c02b74(); +} diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl new file mode 100644 index 0000000000..7fea1e2eb6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_c07013() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c07013(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c07013(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c07013(); +} diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl new file mode 100644 index 0000000000..f46158a7fc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_c07013() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_c07013(); + return; +} + +void fragment_main() { + textureLoad_c07013(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c07013(); + return; +} + + +tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_vwsIDu:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl new file mode 100644 index 0000000000..6fa38577d6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c07013() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_c07013(); + return; +} + +fragment void fragment_main() { + textureLoad_c07013(); + return; +} + +kernel void compute_main() { + textureLoad_c07013(); + return; +} + + +tint_uSEFIK.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm new file mode 100644 index 0000000000..1ac9c62a6c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c07013 "textureLoad_c07013" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_c07013 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_c07013 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_c07013 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_c07013 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl new file mode 100644 index 0000000000..4d5871808f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c07013.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_c07013() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c07013(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c07013(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c07013(); +} diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl new file mode 100644 index 0000000000..2736bfe8ee --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureLoad_c2a480() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c2a480(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c2a480(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c2a480(); +} diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl new file mode 100644 index 0000000000..5e1b7429dd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_c2a480() { + int4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_c2a480(); + return; +} + +void fragment_main() { + textureLoad_c2a480(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c2a480(); + return; +} + + +tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_iO1fuJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl new file mode 100644 index 0000000000..d7f7741e4d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c2a480() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_c2a480(); + return; +} + +fragment void fragment_main() { + textureLoad_c2a480(); + return; +} + +kernel void compute_main() { + textureLoad_c2a480(); + return; +} + + +tint_PlRj7V.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm new file mode 100644 index 0000000000..4c6fed79ad --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c2a480 "textureLoad_c2a480" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_c2a480 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4int %15 %17 Lod %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_c2a480 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_c2a480 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_c2a480 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl new file mode 100644 index 0000000000..41189cfc12 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c2a480.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureLoad_c2a480() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c2a480(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c2a480(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c2a480(); +} diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl new file mode 100644 index 0000000000..b602b0b6b9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureLoad_c378ee() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c378ee(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c378ee(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c378ee(); +} diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl new file mode 100644 index 0000000000..de64c52c24 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.hlsl @@ -0,0 +1,51 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DMS arg_0 : register(t0, space1); + +void textureLoad_c378ee() { + uint4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_c378ee(); + return; +} + +void fragment_main() { + textureLoad_c378ee(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c378ee(); + return; +} + + +tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ +tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion] + uint4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ +tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion] + uint4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_xcs7fj:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0), 1); + ^ +tint_xcs7fj:4:26: warning: implicit truncation of vector type [-Wconversion] + uint4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl new file mode 100644 index 0000000000..c7280359ac --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c378ee() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_c378ee(); + return; +} + +fragment void fragment_main() { + textureLoad_c378ee(); + return; +} + +kernel void compute_main() { + textureLoad_c378ee(); + return; +} + + +tint_8pq22X.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm new file mode 100644 index 0000000000..5a547d0417 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c378ee "textureLoad_c378ee" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_c378ee = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4uint %15 %18 Sample %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_c378ee + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_c378ee + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_c378ee + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl new file mode 100644 index 0000000000..f118f6e21b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c378ee.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureLoad_c378ee() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c378ee(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c378ee(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c378ee(); +} diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl new file mode 100644 index 0000000000..ba0ed97f10 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_c40dcb() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c40dcb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c40dcb(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c40dcb(); +} diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl new file mode 100644 index 0000000000..42c8b6a665 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_c40dcb() { + uint4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_c40dcb(); + return; +} + +void fragment_main() { + textureLoad_c40dcb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c40dcb(); + return; +} + + +tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_nOyzgu:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl new file mode 100644 index 0000000000..b100805356 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c40dcb() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_c40dcb(); + return; +} + +fragment void fragment_main() { + textureLoad_c40dcb(); + return; +} + +kernel void compute_main() { + textureLoad_c40dcb(); + return; +} + + +tint_AHh86e.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm new file mode 100644 index 0000000000..843dad92c7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c40dcb "textureLoad_c40dcb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_c40dcb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %19 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_c40dcb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_c40dcb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_c40dcb + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl new file mode 100644 index 0000000000..e215fc8c42 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c40dcb.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_c40dcb() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c40dcb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c40dcb(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c40dcb(); +} diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl new file mode 100644 index 0000000000..484739de41 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_c456bc() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c456bc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c456bc(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c456bc(); +} diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl new file mode 100644 index 0000000000..3a38cae334 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_c456bc() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_c456bc(); + return; +} + +void fragment_main() { + textureLoad_c456bc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c456bc(); + return; +} + + +tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_QnncaH:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl new file mode 100644 index 0000000000..bd9098af12 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c456bc() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_c456bc(); + return; +} + +fragment void fragment_main() { + textureLoad_c456bc(); + return; +} + +kernel void compute_main() { + textureLoad_c456bc(); + return; +} + + +tint_lhWQnt.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm new file mode 100644 index 0000000000..92d96edd9a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c456bc "textureLoad_c456bc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_c456bc = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_c456bc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_c456bc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_c456bc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl new file mode 100644 index 0000000000..0c3ace93af --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c456bc.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_c456bc() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c456bc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c456bc(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c456bc(); +} diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl new file mode 100644 index 0000000000..983bfe3f9d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_c7cbed() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c7cbed(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c7cbed(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c7cbed(); +} diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl new file mode 100644 index 0000000000..1ad636dcdc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_c7cbed() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_c7cbed(); + return; +} + +void fragment_main() { + textureLoad_c7cbed(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c7cbed(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl new file mode 100644 index 0000000000..1ad0d4f61b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c7cbed() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_c7cbed(); + return; +} + +fragment void fragment_main() { + textureLoad_c7cbed(); + return; +} + +kernel void compute_main() { + textureLoad_c7cbed(); + return; +} + + +tint_Tj6Pxg.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm new file mode 100644 index 0000000000..d63ee64e12 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c7cbed "textureLoad_c7cbed" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_c7cbed = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_c7cbed + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_c7cbed + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_c7cbed + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl new file mode 100644 index 0000000000..76bbb348b4 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c7cbed.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_c7cbed() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c7cbed(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c7cbed(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c7cbed(); +} diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl new file mode 100644 index 0000000000..0825e3e491 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_c9cc40() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c9cc40(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c9cc40(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c9cc40(); +} diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl new file mode 100644 index 0000000000..c46ef6a1c0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_c9cc40() { + int4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_c9cc40(); + return; +} + +void fragment_main() { + textureLoad_c9cc40(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_c9cc40(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl new file mode 100644 index 0000000000..75907b0f49 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_c9cc40() { + int4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_c9cc40(); + return; +} + +fragment void fragment_main() { + textureLoad_c9cc40(); + return; +} + +kernel void compute_main() { + textureLoad_c9cc40(); + return; +} + + +tint_BXWR82.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm new file mode 100644 index 0000000000..7716717014 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_c9cc40 "textureLoad_c9cc40" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_c9cc40 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_c9cc40 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_c9cc40 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_c9cc40 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl new file mode 100644 index 0000000000..8cc767084e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/c9cc40.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_c9cc40() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_c9cc40(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_c9cc40(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_c9cc40(); +} diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl new file mode 100644 index 0000000000..8578b8609e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_d5c48d() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d5c48d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d5c48d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d5c48d(); +} diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl new file mode 100644 index 0000000000..4bd5092eb7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_d5c48d() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_d5c48d(); + return; +} + +void fragment_main() { + textureLoad_d5c48d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_d5c48d(); + return; +} + + +tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_UeYBhz:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl new file mode 100644 index 0000000000..3af5b1a1fb --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_d5c48d() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_d5c48d(); + return; +} + +fragment void fragment_main() { + textureLoad_d5c48d(); + return; +} + +kernel void compute_main() { + textureLoad_d5c48d(); + return; +} + + +tint_caH8d9.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm new file mode 100644 index 0000000000..194a0dca80 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_d5c48d "textureLoad_d5c48d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_d5c48d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_d5c48d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_d5c48d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_d5c48d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl new file mode 100644 index 0000000000..111f88a5da --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d5c48d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_d5c48d() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d5c48d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d5c48d(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d5c48d(); +} diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl new file mode 100644 index 0000000000..c59a55a2fd --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_d81c57() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d81c57(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d81c57(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d81c57(); +} diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl new file mode 100644 index 0000000000..3c88ef980a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_d81c57() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_d81c57(); + return; +} + +void fragment_main() { + textureLoad_d81c57(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_d81c57(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl new file mode 100644 index 0000000000..3270b75945 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_d81c57() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_d81c57(); + return; +} + +fragment void fragment_main() { + textureLoad_d81c57(); + return; +} + +kernel void compute_main() { + textureLoad_d81c57(); + return; +} + + +tint_PBHoWY.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm new file mode 100644 index 0000000000..a0a3217ad8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_d81c57 "textureLoad_d81c57" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_d81c57 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_d81c57 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_d81c57 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_d81c57 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl new file mode 100644 index 0000000000..ef9b797212 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d81c57.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_d81c57() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d81c57(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d81c57(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d81c57(); +} diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl new file mode 100644 index 0000000000..7a14592478 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_d8617f() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d8617f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d8617f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d8617f(); +} diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl new file mode 100644 index 0000000000..32ca152abc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_d8617f() { + int4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_d8617f(); + return; +} + +void fragment_main() { + textureLoad_d8617f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_d8617f(); + return; +} + + +tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_yt2JYq:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl new file mode 100644 index 0000000000..83ef6bebb1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_d8617f() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_d8617f(); + return; +} + +fragment void fragment_main() { + textureLoad_d8617f(); + return; +} + +kernel void compute_main() { + textureLoad_d8617f(); + return; +} + + +tint_kOdpG9.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm new file mode 100644 index 0000000000..bc71530beb --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_d8617f "textureLoad_d8617f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_d8617f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_d8617f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_d8617f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_d8617f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl new file mode 100644 index 0000000000..7a9f7a3ca9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/d8617f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_d8617f() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_d8617f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_d8617f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_d8617f(); +} diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl new file mode 100644 index 0000000000..d14f010084 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_dbd554() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_dbd554(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_dbd554(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_dbd554(); +} diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl new file mode 100644 index 0000000000..cad23b2395 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_dbd554() { + int4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_dbd554(); + return; +} + +void fragment_main() { + textureLoad_dbd554(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_dbd554(); + return; +} + + +tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_SLZaZo:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl new file mode 100644 index 0000000000..4db5a4a8b2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_dbd554() { + int4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_dbd554(); + return; +} + +fragment void fragment_main() { + textureLoad_dbd554(); + return; +} + +kernel void compute_main() { + textureLoad_dbd554(); + return; +} + + +tint_u9YBmc.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm new file mode 100644 index 0000000000..384a41ede0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_dbd554 "textureLoad_dbd554" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_dbd554 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_dbd554 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_dbd554 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_dbd554 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl new file mode 100644 index 0000000000..2e967b48a3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dbd554.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_dbd554() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_dbd554(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_dbd554(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_dbd554(); +} diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl new file mode 100644 index 0000000000..282486b0ea --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_ddeed3() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ddeed3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ddeed3(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ddeed3(); +} diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl new file mode 100644 index 0000000000..dc13a6ac5f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_ddeed3() { + int4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_ddeed3(); + return; +} + +void fragment_main() { + textureLoad_ddeed3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_ddeed3(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl new file mode 100644 index 0000000000..6a9a8d246a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_ddeed3() { + int4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_ddeed3(); + return; +} + +fragment void fragment_main() { + textureLoad_ddeed3(); + return; +} + +kernel void compute_main() { + textureLoad_ddeed3(); + return; +} + + +tint_WoGoyA.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm new file mode 100644 index 0000000000..f64fd4b334 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_ddeed3 "textureLoad_ddeed3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_ddeed3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_ddeed3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_ddeed3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_ddeed3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl new file mode 100644 index 0000000000..90301b7be7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ddeed3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_ddeed3() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ddeed3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ddeed3(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ddeed3(); +} diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl new file mode 100644 index 0000000000..28cb9dcc0a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_dee8e7() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_dee8e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_dee8e7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_dee8e7(); +} diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl new file mode 100644 index 0000000000..37754acea2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_dee8e7() { + int4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_dee8e7(); + return; +} + +void fragment_main() { + textureLoad_dee8e7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_dee8e7(); + return; +} + + +tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_aYg0gJ:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl new file mode 100644 index 0000000000..247ee7875e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_dee8e7() { + int4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_dee8e7(); + return; +} + +fragment void fragment_main() { + textureLoad_dee8e7(); + return; +} + +kernel void compute_main() { + textureLoad_dee8e7(); + return; +} + + +tint_dUo0qj.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm new file mode 100644 index 0000000000..35d8476cc9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_dee8e7 "textureLoad_dee8e7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_dee8e7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_dee8e7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_dee8e7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_dee8e7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl new file mode 100644 index 0000000000..9d7c3f935c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/dee8e7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_dee8e7() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_dee8e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_dee8e7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_dee8e7(); +} diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl new file mode 100644 index 0000000000..5323c08f1d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureLoad_e3d2cc() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e3d2cc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e3d2cc(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e3d2cc(); +} diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl new file mode 100644 index 0000000000..760683eda2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.hlsl @@ -0,0 +1,51 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DMS arg_0 : register(t0, space1); + +void textureLoad_e3d2cc() { + int4 res = arg_0.Load(int3(0), 1); +} + +void vertex_main() { + textureLoad_e3d2cc(); + return; +} + +void fragment_main() { + textureLoad_e3d2cc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_e3d2cc(); + return; +} + + +tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ +tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion] + int4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ +tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion] + int4 res = arg_0.Load(int3(0), 1); + ^ + + +tint_ANIEwS:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0), 1); + ^ +tint_ANIEwS:4:25: warning: implicit truncation of vector type [-Wconversion] + int4 res = arg_0.Load(int3(0), 1); + ^ + diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl new file mode 100644 index 0000000000..dbe28f353b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_e3d2cc() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_e3d2cc(); + return; +} + +fragment void fragment_main() { + textureLoad_e3d2cc(); + return; +} + +kernel void compute_main() { + textureLoad_e3d2cc(); + return; +} + + +tint_lPhrIU.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm new file mode 100644 index 0000000000..c3ba65e067 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_e3d2cc "textureLoad_e3d2cc" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_e3d2cc = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageFetch %v4int %15 %17 Sample %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_e3d2cc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_e3d2cc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_e3d2cc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl new file mode 100644 index 0000000000..eccdf9b8fa --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e3d2cc.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureLoad_e3d2cc() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e3d2cc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e3d2cc(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e3d2cc(); +} diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl new file mode 100644 index 0000000000..c5cd6f4dba --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_e65916() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e65916(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e65916(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e65916(); +} diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl new file mode 100644 index 0000000000..c6aaac40c2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_e65916() { + int4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_e65916(); + return; +} + +void fragment_main() { + textureLoad_e65916(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_e65916(); + return; +} + + +tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + + +tint_6JKVm3:4:30: error: too few elements in vector initialization (expected 4 elements, have 1) + int4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl new file mode 100644 index 0000000000..2bf7b4e10e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_e65916() { + int4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_e65916(); + return; +} + +fragment void fragment_main() { + textureLoad_e65916(); + return; +} + +kernel void compute_main() { + textureLoad_e65916(); + return; +} + + +tint_JtCsT6.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm new file mode 100644 index 0000000000..c46e235186 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_e65916 "textureLoad_e65916" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_e65916 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_e65916 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_e65916 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_e65916 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl new file mode 100644 index 0000000000..f3f6648fe8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e65916.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_e65916() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e65916(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e65916(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e65916(); +} diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl new file mode 100644 index 0000000000..7774adef20 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_e893d7() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e893d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e893d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e893d7(); +} diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl new file mode 100644 index 0000000000..a030b91c27 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_e893d7() { + float4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_e893d7(); + return; +} + +void fragment_main() { + textureLoad_e893d7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_e893d7(); + return; +} + + +tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + + +tint_DMD0a9:4:32: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl new file mode 100644 index 0000000000..39460ff615 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_e893d7() { + float4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_e893d7(); + return; +} + +fragment void fragment_main() { + textureLoad_e893d7(); + return; +} + +kernel void compute_main() { + textureLoad_e893d7(); + return; +} + + +tint_hiyLRu.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm new file mode 100644 index 0000000000..3268cd207c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_e893d7 "textureLoad_e893d7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_e893d7 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_e893d7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_e893d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_e893d7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl new file mode 100644 index 0000000000..4cb54fa149 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/e893d7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_e893d7() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_e893d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_e893d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_e893d7(); +} diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl new file mode 100644 index 0000000000..895a08dd27 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_eb573b() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_eb573b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_eb573b(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_eb573b(); +} diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl new file mode 100644 index 0000000000..0bdfa79443 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_eb573b() { + int4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_eb573b(); + return; +} + +void fragment_main() { + textureLoad_eb573b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_eb573b(); + return; +} + + +tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + + +tint_LzeeML:4:30: error: too few elements in vector initialization (expected 3 elements, have 1) + int4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl new file mode 100644 index 0000000000..3c7011ff82 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_eb573b() { + int4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_eb573b(); + return; +} + +fragment void fragment_main() { + textureLoad_eb573b(); + return; +} + +kernel void compute_main() { + textureLoad_eb573b(); + return; +} + + +tint_1uDHrX.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm new file mode 100644 index 0000000000..fbebdb8578 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_eb573b "textureLoad_eb573b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int +%_ptr_Function_v4int = OpTypePointer Function %v4int + %20 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_eb573b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %20 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %17 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_eb573b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_eb573b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_eb573b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl new file mode 100644 index 0000000000..9b8ee432a5 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/eb573b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_eb573b() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_eb573b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_eb573b(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_eb573b(); +} diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl new file mode 100644 index 0000000000..5ee1d3d96e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureLoad_ecc823() { + var res: vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ecc823(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ecc823(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ecc823(); +} diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl new file mode 100644 index 0000000000..b801b02845 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2D arg_0 : register(t0, space1); + +void textureLoad_ecc823() { + uint4 res = arg_0.Load(int3(0)); +} + +void vertex_main() { + textureLoad_ecc823(); + return; +} + +void fragment_main() { + textureLoad_ecc823(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_ecc823(); + return; +} + + +tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + + +tint_tjkojb:4:31: error: too few elements in vector initialization (expected 3 elements, have 1) + uint4 res = arg_0.Load(int3(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl new file mode 100644 index 0000000000..22cf47c10b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_ecc823() { + uint4 res = arg_0.read(int2()); +} + +vertex void vertex_main() { + textureLoad_ecc823(); + return; +} + +fragment void fragment_main() { + textureLoad_ecc823(); + return; +} + +kernel void compute_main() { + textureLoad_ecc823(); + return; +} + + +tint_uJWcQ6.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm new file mode 100644 index 0000000000..19b1a05847 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_ecc823 "textureLoad_ecc823" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %18 = OpConstantNull %v2int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_ecc823 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_ecc823 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_ecc823 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_ecc823 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl new file mode 100644 index 0000000000..9a6a7886f4 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ecc823.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d; + +fn textureLoad_ecc823() { + var res : vec4 = textureLoad(arg_0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ecc823(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ecc823(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ecc823(); +} diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl new file mode 100644 index 0000000000..8273c31f28 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_ef5405() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ef5405(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ef5405(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ef5405(); +} diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl new file mode 100644 index 0000000000..af010dd9d1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_ef5405() { + uint4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_ef5405(); + return; +} + +void fragment_main() { + textureLoad_ef5405(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_ef5405(); + return; +} + + +tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_wn24Zg:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl new file mode 100644 index 0000000000..cc99a0b224 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_ef5405() { + uint4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_ef5405(); + return; +} + +fragment void fragment_main() { + textureLoad_ef5405(); + return; +} + +kernel void compute_main() { + textureLoad_ef5405(); + return; +} + + +tint_vn4Gjj.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm new file mode 100644 index 0000000000..e14736cbc6 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_ef5405 "textureLoad_ef5405" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_ef5405 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_ef5405 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_ef5405 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_ef5405 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl new file mode 100644 index 0000000000..3a9ed2819a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/ef5405.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_ef5405() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_ef5405(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_ef5405(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_ef5405(); +} diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl new file mode 100644 index 0000000000..72c83bbb82 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_f06b69() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f06b69(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f06b69(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f06b69(); +} diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl new file mode 100644 index 0000000000..981779d335 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_f06b69() { + int4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_f06b69(); + return; +} + +void fragment_main() { + textureLoad_f06b69(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_f06b69(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl new file mode 100644 index 0000000000..0546f3ecf9 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_f06b69() { + int4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_f06b69(); + return; +} + +fragment void fragment_main() { + textureLoad_f06b69(); + return; +} + +kernel void compute_main() { + textureLoad_f06b69(); + return; +} + + +tint_hzLYnu.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm new file mode 100644 index 0000000000..73941813e7 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_f06b69 "textureLoad_f06b69" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_f06b69 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %19 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %int_1 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_f06b69 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_f06b69 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_f06b69 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl new file mode 100644 index 0000000000..aa69f056bc --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f06b69.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_f06b69() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f06b69(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f06b69(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f06b69(); +} diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl new file mode 100644 index 0000000000..eccd87f291 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_f379e2() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f379e2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f379e2(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f379e2(); +} diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl new file mode 100644 index 0000000000..e35c3e5a5d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_f379e2() { + float4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_f379e2(); + return; +} + +void fragment_main() { + textureLoad_f379e2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_f379e2(); + return; +} + + +tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_fpAFiR:4:32: error: too few elements in vector initialization (expected 4 elements, have 2) + float4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl new file mode 100644 index 0000000000..d99131f76b --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_f379e2() { + float4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_f379e2(); + return; +} + +fragment void fragment_main() { + textureLoad_f379e2(); + return; +} + +kernel void compute_main() { + textureLoad_f379e2(); + return; +} + + +tint_noH5on.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm new file mode 100644 index 0000000000..18bdda16b0 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_f379e2 "textureLoad_f379e2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_f379e2 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %18 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_f379e2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_f379e2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_f379e2 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl new file mode 100644 index 0000000000..ac8b4b3540 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f379e2.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_f379e2() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f379e2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f379e2(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f379e2(); +} diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl new file mode 100644 index 0000000000..17a36542da --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_f56e6f() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f56e6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f56e6f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f56e6f(); +} diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl new file mode 100644 index 0000000000..654bdf889f --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_f56e6f() { + uint4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_f56e6f(); + return; +} + +void fragment_main() { + textureLoad_f56e6f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_f56e6f(); + return; +} + + +tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + + +tint_qJ0MK4:4:31: error: too few elements in vector initialization (expected 4 elements, have 1) + uint4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl new file mode 100644 index 0000000000..56cb753bb3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_f56e6f() { + uint4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_f56e6f(); + return; +} + +fragment void fragment_main() { + textureLoad_f56e6f(); + return; +} + +kernel void compute_main() { + textureLoad_f56e6f(); + return; +} + + +tint_bZeB2M.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm new file mode 100644 index 0000000000..882c01ea77 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_f56e6f "textureLoad_f56e6f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %18 = OpConstantNull %v3int +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %21 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_f56e6f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_f56e6f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_f56e6f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_f56e6f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl new file mode 100644 index 0000000000..c6ee7db773 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f56e6f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_f56e6f() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f56e6f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f56e6f(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f56e6f(); +} diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl new file mode 100644 index 0000000000..37f1354a4d --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_f74bd8() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f74bd8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f74bd8(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f74bd8(); +} diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl new file mode 100644 index 0000000000..6d554dac1a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_f74bd8() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_f74bd8(); + return; +} + +void fragment_main() { + textureLoad_f74bd8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_f74bd8(); + return; +} + + +tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_8BEglU:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl new file mode 100644 index 0000000000..5de8a78632 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_f74bd8() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_f74bd8(); + return; +} + +fragment void fragment_main() { + textureLoad_f74bd8(); + return; +} + +kernel void compute_main() { + textureLoad_f74bd8(); + return; +} + + +tint_bvWoiL.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm new file mode 100644 index 0000000000..1713cb85c1 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_f74bd8 "textureLoad_f74bd8" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_f74bd8 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_f74bd8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_f74bd8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_f74bd8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl new file mode 100644 index 0000000000..91cf3018bb --- /dev/null +++ b/test/intrinsics/gen/textureLoad/f74bd8.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_f74bd8() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_f74bd8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_f74bd8(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_f74bd8(); +} diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl new file mode 100644 index 0000000000..48ae1d7d7c --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_fc6d36() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fc6d36(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fc6d36(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fc6d36(); +} diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl new file mode 100644 index 0000000000..d316dbf569 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_fc6d36() { + int4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_fc6d36(); + return; +} + +void fragment_main() { + textureLoad_fc6d36(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_fc6d36(); + return; +} + + +tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_Lm3Z3W:4:30: error: too few elements in vector initialization (expected 4 elements, have 2) + int4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl new file mode 100644 index 0000000000..c7261b4b76 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_fc6d36() { + int4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_fc6d36(); + return; +} + +fragment void fragment_main() { + textureLoad_fc6d36(); + return; +} + +kernel void compute_main() { + textureLoad_fc6d36(); + return; +} + + +tint_8IAy2k.metal:5:14: error: use of undeclared identifier 'arg_0' + int4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm new file mode 100644 index 0000000000..aa02704186 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.spvasm @@ -0,0 +1,72 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_fc6d36 "textureLoad_fc6d36" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4int = OpTypeVector %int 4 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4int = OpTypePointer Function %v4int + %21 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureLoad_fc6d36 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4int Function %21 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4int %15 %18 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureLoad_fc6d36 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureLoad_fc6d36 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureLoad_fc6d36 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl new file mode 100644 index 0000000000..c08523c024 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fc6d36.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_fc6d36() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fc6d36(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fc6d36(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fc6d36(); +} diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl new file mode 100644 index 0000000000..5a977acc5e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureLoad_fdebd0() { + var res: vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fdebd0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fdebd0(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fdebd0(); +} diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl new file mode 100644 index 0000000000..ac749d44ca --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); + +void textureLoad_fdebd0() { + uint4 res = arg_0.Load(int4(1, 0)); +} + +void vertex_main() { + textureLoad_fdebd0(); + return; +} + +void fragment_main() { + textureLoad_fdebd0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_fdebd0(); + return; +} + + +tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + + +tint_cI4djR:4:31: error: too few elements in vector initialization (expected 4 elements, have 2) + uint4 res = arg_0.Load(int4(1, 0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl new file mode 100644 index 0000000000..29c550337e --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_fdebd0() { + uint4 res = arg_0.read(int2(), 1); +} + +vertex void vertex_main() { + textureLoad_fdebd0(); + return; +} + +fragment void fragment_main() { + textureLoad_fdebd0(); + return; +} + +kernel void compute_main() { + textureLoad_fdebd0(); + return; +} + + +tint_NgCD5o.metal:5:15: error: use of undeclared identifier 'arg_0' + uint4 res = arg_0.read(int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm new file mode 100644 index 0000000000..1d390301e8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 33 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_fdebd0 "textureLoad_fdebd0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v4uint = OpTypeVector %uint 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %19 = OpConstantComposite %v3int %int_1 +%_ptr_Function_v4uint = OpTypePointer Function %v4uint + %22 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureLoad_fdebd0 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_v4uint Function %22 + %15 = OpLoad %7 %arg_0 + %13 = OpImageRead %v4uint %15 %19 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %24 = OpLabel + OpStore %tint_pointsize %float_1 + %26 = OpFunctionCall %void %textureLoad_fdebd0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_fdebd0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %31 = OpLabel + %32 = OpFunctionCall %void %textureLoad_fdebd0 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '16[%v3int]'s vector component count. + %19 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl new file mode 100644 index 0000000000..89933737eb --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fdebd0.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureLoad_fdebd0() { + var res : vec4 = textureLoad(arg_0, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fdebd0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fdebd0(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fdebd0(); +} diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl new file mode 100644 index 0000000000..0f8f96024a --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureLoad_fe222a() { + var res: vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fe222a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fe222a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fe222a(); +} diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl new file mode 100644 index 0000000000..bb2a0b03e2 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +Texture1D arg_0 : register(t0, space1); + +void textureLoad_fe222a() { + float4 res = arg_0.Load(int2(1, 0)); +} + +void vertex_main() { + textureLoad_fe222a(); + return; +} + +void fragment_main() { + textureLoad_fe222a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_fe222a(); + return; +} + diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl new file mode 100644 index 0000000000..c8c0402490 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_fe222a() { + float4 res = arg_0.read(1); +} + +vertex void vertex_main() { + textureLoad_fe222a(); + return; +} + +fragment void fragment_main() { + textureLoad_fe222a(); + return; +} + +kernel void compute_main() { + textureLoad_fe222a(); + return; +} + + +tint_cXPONM.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm new file mode 100644 index 0000000000..7ef1da7907 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_fe222a "textureLoad_fe222a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_fe222a = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %19 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %int_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureLoad_fe222a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureLoad_fe222a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureLoad_fe222a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl new file mode 100644 index 0000000000..f6ac8774c3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/fe222a.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_1d; + +fn textureLoad_fe222a() { + var res : vec4 = textureLoad(arg_0, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_fe222a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_fe222a(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_fe222a(); +} diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl new file mode 100644 index 0000000000..8f36ccb6f3 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureLoad_feab99() { + var res: vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_feab99(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_feab99(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_feab99(); +} diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl new file mode 100644 index 0000000000..f720249f62 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +Texture3D arg_0 : register(t0, space1); + +void textureLoad_feab99() { + float4 res = arg_0.Load(int4(0)); +} + +void vertex_main() { + textureLoad_feab99(); + return; +} + +void fragment_main() { + textureLoad_feab99(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureLoad_feab99(); + return; +} + + +tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + + +tint_ChEjEj:4:32: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Load(int4(0)); + ^ + diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl new file mode 100644 index 0000000000..b456fefea8 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureLoad_feab99() { + float4 res = arg_0.read(int3()); +} + +vertex void vertex_main() { + textureLoad_feab99(); + return; +} + +fragment void fragment_main() { + textureLoad_feab99(); + return; +} + +kernel void compute_main() { + textureLoad_feab99(); + return; +} + + +tint_7aCudT.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.read(int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm new file mode 100644 index 0000000000..31c2a72cac --- /dev/null +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureLoad_feab99 "textureLoad_feab99" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %20 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureLoad_feab99 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %20 + %14 = OpLoad %7 %arg_0 + %12 = OpImageRead %v4float %14 %17 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureLoad_feab99 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureLoad_feab99 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureLoad_feab99 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl new file mode 100644 index 0000000000..c0de2b4f74 --- /dev/null +++ b/test/intrinsics/gen/textureLoad/feab99.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_3d; + +fn textureLoad_feab99() { + var res : vec4 = textureLoad(arg_0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureLoad_feab99(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureLoad_feab99(); +} + +[[stage(compute)]] +fn compute_main() { + textureLoad_feab99(); +} diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl new file mode 100644 index 0000000000..fa64259f2c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLayers_024820() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_024820(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_024820(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_024820(); +} diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl new file mode 100644 index 0000000000..066e3c378b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_024820() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_024820(); + return; +} + +void fragment_main() { + textureNumLayers_024820(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_024820(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl new file mode 100644 index 0000000000..0b6d8ec5e6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_024820() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_024820(); + return; +} + +fragment void fragment_main() { + textureNumLayers_024820(); + return; +} + +kernel void compute_main() { + textureNumLayers_024820(); + return; +} + + +tint_0jVx27.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm new file mode 100644 index 0000000000..a5b63d2033 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_024820 "textureNumLayers_024820" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_024820 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_024820 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_024820 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_024820 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl new file mode 100644 index 0000000000..923f42ddce --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/024820.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLayers_024820() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_024820(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_024820(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_024820(); +} diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl new file mode 100644 index 0000000000..a8e1565da6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLayers_053df7() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_053df7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_053df7(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_053df7(); +} diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl new file mode 100644 index 0000000000..5d43efdd79 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLayers_053df7() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_053df7(); + return; +} + +void fragment_main() { + textureNumLayers_053df7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_053df7(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl new file mode 100644 index 0000000000..dccaf5947e --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_053df7() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_053df7(); + return; +} + +fragment void fragment_main() { + textureNumLayers_053df7(); + return; +} + +kernel void compute_main() { + textureNumLayers_053df7(); + return; +} + + +tint_eUidBR.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm new file mode 100644 index 0000000000..405ee4a6aa --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_053df7 "textureNumLayers_053df7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %21 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_053df7 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySizeLod %v3int %17 %int_0 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureNumLayers_053df7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLayers_053df7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureNumLayers_053df7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl new file mode 100644 index 0000000000..2ff71e2910 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/053df7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLayers_053df7() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_053df7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_053df7(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_053df7(); +} diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl new file mode 100644 index 0000000000..c3530b1eb1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_058cc3() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_058cc3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_058cc3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_058cc3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl new file mode 100644 index 0000000000..bea559a1dd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_058cc3() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_058cc3(); + return; +} + +void fragment_main() { + textureNumLayers_058cc3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_058cc3(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl new file mode 100644 index 0000000000..0c8213e7ca --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_058cc3() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_058cc3(); + return; +} + +fragment void fragment_main() { + textureNumLayers_058cc3(); + return; +} + +kernel void compute_main() { + textureNumLayers_058cc3(); + return; +} + + +tint_2AGSfO.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm new file mode 100644 index 0000000000..987181302f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_058cc3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_058cc3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_058cc3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_058cc3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl new file mode 100644 index 0000000000..9ca42303f0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/058cc3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_058cc3() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_058cc3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_058cc3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_058cc3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl new file mode 100644 index 0000000000..7522096066 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_09d05d() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_09d05d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_09d05d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_09d05d(); +} diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl new file mode 100644 index 0000000000..8b0879e7e3 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_09d05d() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_09d05d(); + return; +} + +void fragment_main() { + textureNumLayers_09d05d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_09d05d(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl new file mode 100644 index 0000000000..ece1e7d48c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_09d05d() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_09d05d(); + return; +} + +fragment void fragment_main() { + textureNumLayers_09d05d(); + return; +} + +kernel void compute_main() { + textureNumLayers_09d05d(); + return; +} + + +tint_PQwrWX.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm new file mode 100644 index 0000000000..6bbf3f537d --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_09d05d "textureNumLayers_09d05d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_09d05d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_09d05d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_09d05d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_09d05d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl new file mode 100644 index 0000000000..16aa0f2685 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/09d05d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_09d05d() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_09d05d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_09d05d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_09d05d(); +} diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl new file mode 100644 index 0000000000..33f4131965 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_13b4ce() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_13b4ce(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_13b4ce(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_13b4ce(); +} diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl new file mode 100644 index 0000000000..a363038680 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_13b4ce() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_13b4ce(); + return; +} + +void fragment_main() { + textureNumLayers_13b4ce(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_13b4ce(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl new file mode 100644 index 0000000000..068f3950f8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_13b4ce() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_13b4ce(); + return; +} + +fragment void fragment_main() { + textureNumLayers_13b4ce(); + return; +} + +kernel void compute_main() { + textureNumLayers_13b4ce(); + return; +} + + +tint_LccGuI.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm new file mode 100644 index 0000000000..0c5d315e36 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_13b4ce = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_13b4ce + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_13b4ce + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_13b4ce + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl new file mode 100644 index 0000000000..f6dfe9fb87 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/13b4ce.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_13b4ce() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_13b4ce(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_13b4ce(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_13b4ce(); +} diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl new file mode 100644 index 0000000000..568367ecd0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_22e53b() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_22e53b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_22e53b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_22e53b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl new file mode 100644 index 0000000000..1d275f4671 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_22e53b() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_22e53b(); + return; +} + +void fragment_main() { + textureNumLayers_22e53b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_22e53b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl new file mode 100644 index 0000000000..c00e965f6f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_22e53b() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_22e53b(); + return; +} + +fragment void fragment_main() { + textureNumLayers_22e53b(); + return; +} + +kernel void compute_main() { + textureNumLayers_22e53b(); + return; +} + + +tint_HhSnq0.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm new file mode 100644 index 0000000000..162d072c34 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_22e53b "textureNumLayers_22e53b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_22e53b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_22e53b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_22e53b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_22e53b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl new file mode 100644 index 0000000000..8e51176e39 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/22e53b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_22e53b() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_22e53b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_22e53b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_22e53b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl new file mode 100644 index 0000000000..d0ac8df83e --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_2f6bb3() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_2f6bb3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_2f6bb3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_2f6bb3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl new file mode 100644 index 0000000000..b4f57801ee --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_2f6bb3() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_2f6bb3(); + return; +} + +void fragment_main() { + textureNumLayers_2f6bb3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_2f6bb3(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl new file mode 100644 index 0000000000..46f833c267 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_2f6bb3() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_2f6bb3(); + return; +} + +fragment void fragment_main() { + textureNumLayers_2f6bb3(); + return; +} + +kernel void compute_main() { + textureNumLayers_2f6bb3(); + return; +} + + +tint_h3OOas.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm new file mode 100644 index 0000000000..deb036d997 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_2f6bb3 "textureNumLayers_2f6bb3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_2f6bb3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_2f6bb3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_2f6bb3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_2f6bb3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl new file mode 100644 index 0000000000..841cafc0eb --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/2f6bb3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_2f6bb3() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_2f6bb3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_2f6bb3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_2f6bb3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl new file mode 100644 index 0000000000..1cd07fd163 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_315298() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_315298(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_315298(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_315298(); +} diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl new file mode 100644 index 0000000000..637db425be --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_315298() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_315298(); + return; +} + +void fragment_main() { + textureNumLayers_315298(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_315298(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl new file mode 100644 index 0000000000..7e83a77882 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_315298() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_315298(); + return; +} + +fragment void fragment_main() { + textureNumLayers_315298(); + return; +} + +kernel void compute_main() { + textureNumLayers_315298(); + return; +} + + +tint_GjCxCH.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm new file mode 100644 index 0000000000..3ff059ad13 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_315298 "textureNumLayers_315298" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_315298 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_315298 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_315298 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_315298 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl new file mode 100644 index 0000000000..5f0a525385 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/315298.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_315298() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_315298(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_315298(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_315298(); +} diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl new file mode 100644 index 0000000000..2dd6eaada8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_3615e3() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_3615e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_3615e3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_3615e3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl new file mode 100644 index 0000000000..acb2945280 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_3615e3() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_3615e3(); + return; +} + +void fragment_main() { + textureNumLayers_3615e3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_3615e3(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl new file mode 100644 index 0000000000..6946205873 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_3615e3() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_3615e3(); + return; +} + +fragment void fragment_main() { + textureNumLayers_3615e3(); + return; +} + +kernel void compute_main() { + textureNumLayers_3615e3(); + return; +} + + +tint_57kzTT.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm new file mode 100644 index 0000000000..ecc75eff2e --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_3615e3 "textureNumLayers_3615e3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_3615e3 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_3615e3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_3615e3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_3615e3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl new file mode 100644 index 0000000000..f248320e8a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/3615e3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_3615e3() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_3615e3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_3615e3(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_3615e3(); +} diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl new file mode 100644 index 0000000000..044fa9927b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_390fd5() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_390fd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_390fd5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_390fd5(); +} diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl new file mode 100644 index 0000000000..9ab80c5ba1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_390fd5() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_390fd5(); + return; +} + +void fragment_main() { + textureNumLayers_390fd5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_390fd5(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl new file mode 100644 index 0000000000..953ec8a5d9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_390fd5() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_390fd5(); + return; +} + +fragment void fragment_main() { + textureNumLayers_390fd5(); + return; +} + +kernel void compute_main() { + textureNumLayers_390fd5(); + return; +} + + +tint_CaQl5W.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm new file mode 100644 index 0000000000..cd442f82e9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_390fd5 "textureNumLayers_390fd5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_390fd5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_390fd5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_390fd5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_390fd5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl new file mode 100644 index 0000000000..91b250e633 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/390fd5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_390fd5() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_390fd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_390fd5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_390fd5(); +} diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl new file mode 100644 index 0000000000..ab2be8b37b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_45155d() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_45155d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_45155d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_45155d(); +} diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl new file mode 100644 index 0000000000..ba95843802 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_45155d() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_45155d(); + return; +} + +void fragment_main() { + textureNumLayers_45155d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_45155d(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl new file mode 100644 index 0000000000..506e75ab28 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_45155d() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_45155d(); + return; +} + +fragment void fragment_main() { + textureNumLayers_45155d(); + return; +} + +kernel void compute_main() { + textureNumLayers_45155d(); + return; +} + + +tint_sM3glL.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm new file mode 100644 index 0000000000..dde6292274 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_45155d "textureNumLayers_45155d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_45155d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_45155d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_45155d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_45155d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl new file mode 100644 index 0000000000..107a74cadb --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/45155d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_45155d() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_45155d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_45155d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_45155d(); +} diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl new file mode 100644 index 0000000000..45bf5f8e8a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_4bf67b() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_4bf67b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_4bf67b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_4bf67b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl new file mode 100644 index 0000000000..629aa521b5 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_4bf67b() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_4bf67b(); + return; +} + +void fragment_main() { + textureNumLayers_4bf67b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_4bf67b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl new file mode 100644 index 0000000000..c89408c019 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_4bf67b() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_4bf67b(); + return; +} + +fragment void fragment_main() { + textureNumLayers_4bf67b(); + return; +} + +kernel void compute_main() { + textureNumLayers_4bf67b(); + return; +} + + +tint_SwyI4f.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm new file mode 100644 index 0000000000..12bd4772e9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_4bf67b "textureNumLayers_4bf67b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_4bf67b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_4bf67b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_4bf67b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_4bf67b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl new file mode 100644 index 0000000000..2185d738d7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/4bf67b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_4bf67b() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_4bf67b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_4bf67b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_4bf67b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl new file mode 100644 index 0000000000..3215988968 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_562013() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_562013(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_562013(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_562013(); +} diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl new file mode 100644 index 0000000000..273ab51b7a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_562013() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_562013(); + return; +} + +void fragment_main() { + textureNumLayers_562013(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_562013(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl new file mode 100644 index 0000000000..a0cbaf4192 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_562013() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_562013(); + return; +} + +fragment void fragment_main() { + textureNumLayers_562013(); + return; +} + +kernel void compute_main() { + textureNumLayers_562013(); + return; +} + + +tint_Dlhv3z.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm new file mode 100644 index 0000000000..2f25a38960 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_562013 "textureNumLayers_562013" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_562013 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_562013 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_562013 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_562013 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl new file mode 100644 index 0000000000..5a217b6265 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/562013.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_562013() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_562013(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_562013(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_562013(); +} diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl new file mode 100644 index 0000000000..f752ba078b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_57092f() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_57092f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_57092f(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_57092f(); +} diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl new file mode 100644 index 0000000000..e50de13993 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_57092f() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_57092f(); + return; +} + +void fragment_main() { + textureNumLayers_57092f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_57092f(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl new file mode 100644 index 0000000000..ca0aac986f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_57092f() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_57092f(); + return; +} + +fragment void fragment_main() { + textureNumLayers_57092f(); + return; +} + +kernel void compute_main() { + textureNumLayers_57092f(); + return; +} + + +tint_OuseLM.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm new file mode 100644 index 0000000000..fdfa698e32 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_57092f "textureNumLayers_57092f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_57092f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_57092f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_57092f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_57092f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl new file mode 100644 index 0000000000..eb7bac54e7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/57092f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_57092f() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_57092f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_57092f(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_57092f(); +} diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl new file mode 100644 index 0000000000..a53d9ee919 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLayers_5d59cd() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_5d59cd(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_5d59cd(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_5d59cd(); +} diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl new file mode 100644 index 0000000000..86b51cbb96 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLayers_5d59cd() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_5d59cd(); + return; +} + +void fragment_main() { + textureNumLayers_5d59cd(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_5d59cd(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl new file mode 100644 index 0000000000..35249ebb00 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_5d59cd() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_5d59cd(); + return; +} + +fragment void fragment_main() { + textureNumLayers_5d59cd(); + return; +} + +kernel void compute_main() { + textureNumLayers_5d59cd(); + return; +} + + +tint_ip3QKE.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm new file mode 100644 index 0000000000..3dc3190bfb --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_5d59cd = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_5d59cd + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_5d59cd + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_5d59cd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl new file mode 100644 index 0000000000..6d6fd6c71f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/5d59cd.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLayers_5d59cd() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_5d59cd(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_5d59cd(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_5d59cd(); +} diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl new file mode 100644 index 0000000000..82ac2b3201 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_68a65b() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_68a65b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_68a65b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_68a65b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl new file mode 100644 index 0000000000..edfd0728cf --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_68a65b() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_68a65b(); + return; +} + +void fragment_main() { + textureNumLayers_68a65b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_68a65b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl new file mode 100644 index 0000000000..94c1ccfc6b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_68a65b() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_68a65b(); + return; +} + +fragment void fragment_main() { + textureNumLayers_68a65b(); + return; +} + +kernel void compute_main() { + textureNumLayers_68a65b(); + return; +} + + +tint_N63zBK.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm new file mode 100644 index 0000000000..164344890b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_68a65b "textureNumLayers_68a65b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_68a65b = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_68a65b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_68a65b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_68a65b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl new file mode 100644 index 0000000000..5b331c24e0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/68a65b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_68a65b() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_68a65b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_68a65b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_68a65b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl new file mode 100644 index 0000000000..54b06152d8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube_array; +fn textureNumLayers_778bd1() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_778bd1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_778bd1(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_778bd1(); +} diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl new file mode 100644 index 0000000000..4bbc51cda8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLayers_778bd1() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_778bd1(); + return; +} + +void fragment_main() { + textureNumLayers_778bd1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_778bd1(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl new file mode 100644 index 0000000000..904ccd936c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_778bd1() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_778bd1(); + return; +} + +fragment void fragment_main() { + textureNumLayers_778bd1(); + return; +} + +kernel void compute_main() { + textureNumLayers_778bd1(); + return; +} + + +tint_jiLWFd.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm new file mode 100644 index 0000000000..8c5776800c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_778bd1 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_778bd1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_778bd1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_778bd1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl new file mode 100644 index 0000000000..43e7c188c8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/778bd1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; + +fn textureNumLayers_778bd1() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_778bd1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_778bd1(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_778bd1(); +} diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl new file mode 100644 index 0000000000..846381a05f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_7f1937() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_7f1937(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_7f1937(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_7f1937(); +} diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl new file mode 100644 index 0000000000..2017e6e695 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_7f1937() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_7f1937(); + return; +} + +void fragment_main() { + textureNumLayers_7f1937(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_7f1937(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl new file mode 100644 index 0000000000..243a8d0e09 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_7f1937() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_7f1937(); + return; +} + +fragment void fragment_main() { + textureNumLayers_7f1937(); + return; +} + +kernel void compute_main() { + textureNumLayers_7f1937(); + return; +} + + +tint_KD1toJ.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm new file mode 100644 index 0000000000..d20fcb0e1a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_7f1937 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_7f1937 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_7f1937 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_7f1937 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl new file mode 100644 index 0000000000..ffec0d1c61 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/7f1937.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_7f1937() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_7f1937(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_7f1937(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_7f1937(); +} diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl new file mode 100644 index 0000000000..665ad712bc --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLayers_85f980() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_85f980(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_85f980(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_85f980(); +} diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl new file mode 100644 index 0000000000..c0aa9c7509 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLayers_85f980() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_85f980(); + return; +} + +void fragment_main() { + textureNumLayers_85f980(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_85f980(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl new file mode 100644 index 0000000000..7eea88ed58 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_85f980() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_85f980(); + return; +} + +fragment void fragment_main() { + textureNumLayers_85f980(); + return; +} + +kernel void compute_main() { + textureNumLayers_85f980(); + return; +} + + +tint_kFnY8n.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm new file mode 100644 index 0000000000..f9ce61fa22 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_85f980 "textureNumLayers_85f980" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_85f980 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_85f980 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_85f980 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_85f980 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl new file mode 100644 index 0000000000..b076871cb7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/85f980.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLayers_85f980() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_85f980(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_85f980(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_85f980(); +} diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl new file mode 100644 index 0000000000..0e8fbe7e0a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLayers_87953e() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_87953e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_87953e(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_87953e(); +} diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl new file mode 100644 index 0000000000..96d638fe32 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_87953e() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_87953e(); + return; +} + +void fragment_main() { + textureNumLayers_87953e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_87953e(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl new file mode 100644 index 0000000000..090725f837 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_87953e() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_87953e(); + return; +} + +fragment void fragment_main() { + textureNumLayers_87953e(); + return; +} + +kernel void compute_main() { + textureNumLayers_87953e(); + return; +} + + +tint_m8n8xs.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm new file mode 100644 index 0000000000..8671f4ade5 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_87953e "textureNumLayers_87953e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %21 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_87953e = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %21 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySizeLod %v3int %17 %int_0 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %23 = OpLabel + OpStore %tint_pointsize %float_1 + %25 = OpFunctionCall %void %textureNumLayers_87953e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLayers_87953e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %30 = OpLabel + %31 = OpFunctionCall %void %textureNumLayers_87953e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl new file mode 100644 index 0000000000..cfd9b954bd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/87953e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLayers_87953e() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_87953e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_87953e(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_87953e(); +} diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl new file mode 100644 index 0000000000..423f9c8070 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLayers_893e7c() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_893e7c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_893e7c(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_893e7c(); +} diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl new file mode 100644 index 0000000000..507cb89fb1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_893e7c() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_893e7c(); + return; +} + +void fragment_main() { + textureNumLayers_893e7c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_893e7c(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl new file mode 100644 index 0000000000..c0fa33fe1c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_893e7c() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_893e7c(); + return; +} + +fragment void fragment_main() { + textureNumLayers_893e7c(); + return; +} + +kernel void compute_main() { + textureNumLayers_893e7c(); + return; +} + + +tint_Klqhaj.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm new file mode 100644 index 0000000000..445ed71d58 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_893e7c "textureNumLayers_893e7c" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_893e7c = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_893e7c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_893e7c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_893e7c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl new file mode 100644 index 0000000000..eb3bf2f0da --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/893e7c.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLayers_893e7c() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_893e7c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_893e7c(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_893e7c(); +} diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl new file mode 100644 index 0000000000..22adab5fbf --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_938763() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_938763(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_938763(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_938763(); +} diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl new file mode 100644 index 0000000000..47da08ae2a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_938763() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_938763(); + return; +} + +void fragment_main() { + textureNumLayers_938763(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_938763(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl new file mode 100644 index 0000000000..f38a402575 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_938763() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_938763(); + return; +} + +fragment void fragment_main() { + textureNumLayers_938763(); + return; +} + +kernel void compute_main() { + textureNumLayers_938763(); + return; +} + + +tint_5XNX1P.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm new file mode 100644 index 0000000000..7fcf149a63 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_938763 "textureNumLayers_938763" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_938763 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_938763 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_938763 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_938763 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl new file mode 100644 index 0000000000..c7a5abca70 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/938763.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_938763() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_938763(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_938763(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_938763(); +} diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl new file mode 100644 index 0000000000..26d33d50e3 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_9700fb() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_9700fb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_9700fb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_9700fb(); +} diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl new file mode 100644 index 0000000000..d08ca80ac1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_9700fb() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_9700fb(); + return; +} + +void fragment_main() { + textureNumLayers_9700fb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_9700fb(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl new file mode 100644 index 0000000000..b72ddf42c1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_9700fb() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_9700fb(); + return; +} + +fragment void fragment_main() { + textureNumLayers_9700fb(); + return; +} + +kernel void compute_main() { + textureNumLayers_9700fb(); + return; +} + + +tint_AtgPjG.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm new file mode 100644 index 0000000000..76f48e32d5 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_9700fb "textureNumLayers_9700fb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_9700fb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_9700fb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_9700fb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_9700fb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl new file mode 100644 index 0000000000..b63c56deea --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/9700fb.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_9700fb() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_9700fb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_9700fb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_9700fb(); +} diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl new file mode 100644 index 0000000000..c3967a492b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_a216d2() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_a216d2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_a216d2(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_a216d2(); +} diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl new file mode 100644 index 0000000000..749335c377 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_a216d2() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_a216d2(); + return; +} + +void fragment_main() { + textureNumLayers_a216d2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_a216d2(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl new file mode 100644 index 0000000000..5439ad7a8c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_a216d2() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_a216d2(); + return; +} + +fragment void fragment_main() { + textureNumLayers_a216d2(); + return; +} + +kernel void compute_main() { + textureNumLayers_a216d2(); + return; +} + + +tint_KEuSt7.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm new file mode 100644 index 0000000000..092addb493 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_a216d2 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_a216d2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_a216d2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_a216d2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl new file mode 100644 index 0000000000..1f18aa063b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/a216d2.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_a216d2() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_a216d2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_a216d2(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_a216d2(); +} diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl new file mode 100644 index 0000000000..5fd1c968da --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_aa08a7() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_aa08a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_aa08a7(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_aa08a7(); +} diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl new file mode 100644 index 0000000000..4c10784bbb --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_aa08a7() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_aa08a7(); + return; +} + +void fragment_main() { + textureNumLayers_aa08a7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_aa08a7(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl new file mode 100644 index 0000000000..3f76dec7bd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_aa08a7() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_aa08a7(); + return; +} + +fragment void fragment_main() { + textureNumLayers_aa08a7(); + return; +} + +kernel void compute_main() { + textureNumLayers_aa08a7(); + return; +} + + +tint_cmcbXy.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm new file mode 100644 index 0000000000..499db639ac --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_aa08a7 "textureNumLayers_aa08a7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_aa08a7 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_aa08a7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_aa08a7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_aa08a7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl new file mode 100644 index 0000000000..82ed03cb26 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/aa08a7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_aa08a7() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_aa08a7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_aa08a7(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_aa08a7(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl new file mode 100644 index 0000000000..b0897169cf --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_ab0c9b() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ab0c9b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ab0c9b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ab0c9b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl new file mode 100644 index 0000000000..c5887d5e1e --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_ab0c9b() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_ab0c9b(); + return; +} + +void fragment_main() { + textureNumLayers_ab0c9b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_ab0c9b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl new file mode 100644 index 0000000000..21af60a0eb --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_ab0c9b() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_ab0c9b(); + return; +} + +fragment void fragment_main() { + textureNumLayers_ab0c9b(); + return; +} + +kernel void compute_main() { + textureNumLayers_ab0c9b(); + return; +} + + +tint_3mx4mu.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm new file mode 100644 index 0000000000..5e486fdd73 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_ab0c9b "textureNumLayers_ab0c9b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_ab0c9b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_ab0c9b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_ab0c9b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_ab0c9b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl new file mode 100644 index 0000000000..1d19a4214b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ab0c9b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_ab0c9b() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ab0c9b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ab0c9b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ab0c9b(); +} diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl new file mode 100644 index 0000000000..ea807196d1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_b8cd76() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_b8cd76(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_b8cd76(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_b8cd76(); +} diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl new file mode 100644 index 0000000000..0e8a101203 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_b8cd76() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_b8cd76(); + return; +} + +void fragment_main() { + textureNumLayers_b8cd76(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_b8cd76(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl new file mode 100644 index 0000000000..8855b9407b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_b8cd76() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_b8cd76(); + return; +} + +fragment void fragment_main() { + textureNumLayers_b8cd76(); + return; +} + +kernel void compute_main() { + textureNumLayers_b8cd76(); + return; +} + + +tint_KU2V1S.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm new file mode 100644 index 0000000000..109c12e5b6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_b8cd76 "textureNumLayers_b8cd76" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_b8cd76 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_b8cd76 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_b8cd76 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_b8cd76 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl new file mode 100644 index 0000000000..c769c1efb3 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/b8cd76.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_b8cd76() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_b8cd76(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_b8cd76(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_b8cd76(); +} diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl new file mode 100644 index 0000000000..0bed34bdf1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_be1d70() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_be1d70(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_be1d70(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_be1d70(); +} diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl new file mode 100644 index 0000000000..a29e8bc2e1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_be1d70() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_be1d70(); + return; +} + +void fragment_main() { + textureNumLayers_be1d70(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_be1d70(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl new file mode 100644 index 0000000000..7e0c20ccb8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_be1d70() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_be1d70(); + return; +} + +fragment void fragment_main() { + textureNumLayers_be1d70(); + return; +} + +kernel void compute_main() { + textureNumLayers_be1d70(); + return; +} + + +tint_0Ia5Gx.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm new file mode 100644 index 0000000000..cbe7eff857 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_be1d70 "textureNumLayers_be1d70" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_be1d70 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_be1d70 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_be1d70 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_be1d70 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl new file mode 100644 index 0000000000..3474b240fc --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be1d70.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_be1d70() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_be1d70(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_be1d70(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_be1d70(); +} diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl new file mode 100644 index 0000000000..b10c46456d --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_be3acb() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_be3acb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_be3acb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_be3acb(); +} diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl new file mode 100644 index 0000000000..fe927b34ba --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_be3acb() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_be3acb(); + return; +} + +void fragment_main() { + textureNumLayers_be3acb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_be3acb(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl new file mode 100644 index 0000000000..a6b169749c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_be3acb() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_be3acb(); + return; +} + +fragment void fragment_main() { + textureNumLayers_be3acb(); + return; +} + +kernel void compute_main() { + textureNumLayers_be3acb(); + return; +} + + +tint_KFyqRK.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm new file mode 100644 index 0000000000..9f51dbd2e9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_be3acb "textureNumLayers_be3acb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_be3acb = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_be3acb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_be3acb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_be3acb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl new file mode 100644 index 0000000000..1d18e594ba --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/be3acb.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_be3acb() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_be3acb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_be3acb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_be3acb(); +} diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl new file mode 100644 index 0000000000..45daa99b02 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_c09917() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_c09917(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_c09917(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_c09917(); +} diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl new file mode 100644 index 0000000000..5753eb4914 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_c09917() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_c09917(); + return; +} + +void fragment_main() { + textureNumLayers_c09917(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_c09917(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl new file mode 100644 index 0000000000..49a302980a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_c09917() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_c09917(); + return; +} + +fragment void fragment_main() { + textureNumLayers_c09917(); + return; +} + +kernel void compute_main() { + textureNumLayers_c09917(); + return; +} + + +tint_TtrZWH.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm new file mode 100644 index 0000000000..98505af7d7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_c09917 "textureNumLayers_c09917" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_c09917 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_c09917 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_c09917 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_c09917 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl new file mode 100644 index 0000000000..bb20c2f01a --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c09917.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_c09917() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_c09917(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_c09917(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_c09917(); +} diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl new file mode 100644 index 0000000000..248fbc90fe --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_c7c7f2() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_c7c7f2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_c7c7f2(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_c7c7f2(); +} diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl new file mode 100644 index 0000000000..4b597603b3 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_c7c7f2() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_c7c7f2(); + return; +} + +void fragment_main() { + textureNumLayers_c7c7f2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_c7c7f2(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl new file mode 100644 index 0000000000..775889c07b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_c7c7f2() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_c7c7f2(); + return; +} + +fragment void fragment_main() { + textureNumLayers_c7c7f2(); + return; +} + +kernel void compute_main() { + textureNumLayers_c7c7f2(); + return; +} + + +tint_92LuOw.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm new file mode 100644 index 0000000000..ed6686cc70 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_c7c7f2 "textureNumLayers_c7c7f2" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_c7c7f2 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_c7c7f2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_c7c7f2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_c7c7f2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl new file mode 100644 index 0000000000..f4de08f414 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/c7c7f2.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_c7c7f2() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_c7c7f2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_c7c7f2(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_c7c7f2(); +} diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl new file mode 100644 index 0000000000..146b08dffc --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_cd5dc8() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_cd5dc8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_cd5dc8(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_cd5dc8(); +} diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl new file mode 100644 index 0000000000..4107f8c9e8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_cd5dc8() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_cd5dc8(); + return; +} + +void fragment_main() { + textureNumLayers_cd5dc8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_cd5dc8(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl new file mode 100644 index 0000000000..be37d58da6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_cd5dc8() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_cd5dc8(); + return; +} + +fragment void fragment_main() { + textureNumLayers_cd5dc8(); + return; +} + +kernel void compute_main() { + textureNumLayers_cd5dc8(); + return; +} + + +tint_7rjv9D.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm new file mode 100644 index 0000000000..29ca74bbd1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_cd5dc8 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_cd5dc8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_cd5dc8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_cd5dc8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl new file mode 100644 index 0000000000..bddc9ba1d7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/cd5dc8.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_cd5dc8() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_cd5dc8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_cd5dc8(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_cd5dc8(); +} diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl new file mode 100644 index 0000000000..191034beb0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_d5b228() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_d5b228(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_d5b228(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_d5b228(); +} diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl new file mode 100644 index 0000000000..2dad2cebb9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_d5b228() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_d5b228(); + return; +} + +void fragment_main() { + textureNumLayers_d5b228(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_d5b228(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl new file mode 100644 index 0000000000..fda4dfe0db --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_d5b228() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_d5b228(); + return; +} + +fragment void fragment_main() { + textureNumLayers_d5b228(); + return; +} + +kernel void compute_main() { + textureNumLayers_d5b228(); + return; +} + + +tint_yPz3Jj.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm new file mode 100644 index 0000000000..dd55d2b3b4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_d5b228 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_d5b228 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_d5b228 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_d5b228 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl new file mode 100644 index 0000000000..e5f7a25916 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/d5b228.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_d5b228() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_d5b228(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_d5b228(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_d5b228(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl new file mode 100644 index 0000000000..92e44777d6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_e15642() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e15642(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e15642(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e15642(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl new file mode 100644 index 0000000000..6615530b10 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_e15642() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_e15642(); + return; +} + +void fragment_main() { + textureNumLayers_e15642(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_e15642(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl new file mode 100644 index 0000000000..dcf2190292 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_e15642() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_e15642(); + return; +} + +fragment void fragment_main() { + textureNumLayers_e15642(); + return; +} + +kernel void compute_main() { + textureNumLayers_e15642(); + return; +} + + +tint_0CbU62.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm new file mode 100644 index 0000000000..15c5d3b149 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_e15642 "textureNumLayers_e15642" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonWritable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_e15642 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_e15642 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_e15642 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_e15642 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl new file mode 100644 index 0000000000..4c1ec30b22 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e15642.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(read)]] texture_storage_2d_array; + +fn textureNumLayers_e15642() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e15642(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e15642(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e15642(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl new file mode 100644 index 0000000000..5564e7ab6c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_e31be1() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e31be1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e31be1(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e31be1(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl new file mode 100644 index 0000000000..68850da0dd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_e31be1() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_e31be1(); + return; +} + +void fragment_main() { + textureNumLayers_e31be1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_e31be1(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl new file mode 100644 index 0000000000..815c6e0b96 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_e31be1() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_e31be1(); + return; +} + +fragment void fragment_main() { + textureNumLayers_e31be1(); + return; +} + +kernel void compute_main() { + textureNumLayers_e31be1(); + return; +} + + +tint_VHnpXj.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm new file mode 100644 index 0000000000..905e2ae80b --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_e31be1 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_e31be1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_e31be1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_e31be1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl new file mode 100644 index 0000000000..910a278f74 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e31be1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_e31be1() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e31be1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e31be1(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e31be1(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl new file mode 100644 index 0000000000..831f136c85 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +fn textureNumLayers_e653c0() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e653c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e653c0(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e653c0(); +} diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl new file mode 100644 index 0000000000..5d592674fd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLayers_e653c0() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_e653c0(); + return; +} + +void fragment_main() { + textureNumLayers_e653c0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_e653c0(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl new file mode 100644 index 0000000000..69f7d4522c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_e653c0() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_e653c0(); + return; +} + +fragment void fragment_main() { + textureNumLayers_e653c0(); + return; +} + +kernel void compute_main() { + textureNumLayers_e653c0(); + return; +} + + +tint_ruSiH5.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm new file mode 100644 index 0000000000..a8ae9ae462 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_0 = OpConstant %int 0 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_e653c0 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySizeLod %v3int %16 %int_0 + %12 = OpCompositeExtract %int %14 2 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_e653c0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_e653c0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_e653c0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl new file mode 100644 index 0000000000..f133adb16f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/e653c0.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +fn textureNumLayers_e653c0() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_e653c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_e653c0(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_e653c0(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl new file mode 100644 index 0000000000..60e2445a33 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_ee942f() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ee942f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ee942f(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ee942f(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl new file mode 100644 index 0000000000..33663d4f34 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_ee942f() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_ee942f(); + return; +} + +void fragment_main() { + textureNumLayers_ee942f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_ee942f(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl new file mode 100644 index 0000000000..233095c731 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_ee942f() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_ee942f(); + return; +} + +fragment void fragment_main() { + textureNumLayers_ee942f(); + return; +} + +kernel void compute_main() { + textureNumLayers_ee942f(); + return; +} + + +tint_RSJrMi.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm new file mode 100644 index 0000000000..773fc743a4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_ee942f "textureNumLayers_ee942f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_ee942f = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_ee942f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_ee942f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_ee942f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl new file mode 100644 index 0000000000..7874222093 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ee942f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_ee942f() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ee942f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ee942f(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ee942f(); +} diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl new file mode 100644 index 0000000000..96fc3e3da2 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_f33005() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_f33005(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_f33005(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_f33005(); +} diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl new file mode 100644 index 0000000000..28dbfcb215 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_f33005() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_f33005(); + return; +} + +void fragment_main() { + textureNumLayers_f33005(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_f33005(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl new file mode 100644 index 0000000000..48bdc8d1c0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_f33005() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_f33005(); + return; +} + +fragment void fragment_main() { + textureNumLayers_f33005(); + return; +} + +kernel void compute_main() { + textureNumLayers_f33005(); + return; +} + + +tint_cU7qBN.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm new file mode 100644 index 0000000000..7237b6c498 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.spvasm @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_f33005 "textureNumLayers_f33005" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %19 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_f33005 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %19 + %16 = OpLoad %7 %arg_0 + %14 = OpImageQuerySize %v3int %16 + %13 = OpCompositeExtract %int %14 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureNumLayers_f33005 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureNumLayers_f33005 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureNumLayers_f33005 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl new file mode 100644 index 0000000000..8211300a2c --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/f33005.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_f33005() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_f33005(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_f33005(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_f33005(); +} diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl new file mode 100644 index 0000000000..47277d1e5d --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_fcec98() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_fcec98(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_fcec98(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_fcec98(); +} diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl new file mode 100644 index 0000000000..921abf0bf5 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_fcec98() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_fcec98(); + return; +} + +void fragment_main() { + textureNumLayers_fcec98(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_fcec98(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl new file mode 100644 index 0000000000..de3f0e70fd --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_fcec98() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_fcec98(); + return; +} + +fragment void fragment_main() { + textureNumLayers_fcec98(); + return; +} + +kernel void compute_main() { + textureNumLayers_fcec98(); + return; +} + + +tint_7cRIpj.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm new file mode 100644 index 0000000000..8c8256e320 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.spvasm @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_fcec98 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_fcec98 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_fcec98 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_fcec98 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl new file mode 100644 index 0000000000..f3cdcf8483 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/fcec98.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_fcec98() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_fcec98(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_fcec98(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_fcec98(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl new file mode 100644 index 0000000000..077109c6c2 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureNumLayers_ff5e89() { + var res: i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ff5e89(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ff5e89(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ff5e89(); +} diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl new file mode 100644 index 0000000000..52e8e30ac7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +RWTexture2DArray arg_0 : register(u0, space1); + +void textureNumLayers_ff5e89() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLayers_ff5e89(); + return; +} + +void fragment_main() { + textureNumLayers_ff5e89(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLayers_ff5e89(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl new file mode 100644 index 0000000000..339f408100 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLayers_ff5e89() { + int res = int(arg_0.get_array_size()); +} + +vertex void vertex_main() { + textureNumLayers_ff5e89(); + return; +} + +fragment void fragment_main() { + textureNumLayers_ff5e89(); + return; +} + +kernel void compute_main() { + textureNumLayers_ff5e89(); + return; +} + + +tint_0FvQko.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_array_size()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm new file mode 100644 index 0000000000..43e4afa148 --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.spvasm @@ -0,0 +1,64 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 +%_ptr_Function_int = OpTypePointer Function %int + %20 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLayers_ff5e89 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %20 + %17 = OpLoad %7 %arg_0 + %15 = OpImageQuerySize %v3int %17 + %13 = OpCompositeExtract %int %15 2 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureNumLayers_ff5e89 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLayers_ff5e89 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureNumLayers_ff5e89 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl new file mode 100644 index 0000000000..dc726f5b9f --- /dev/null +++ b/test/intrinsics/gen/textureNumLayers/ff5e89.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureNumLayers_ff5e89() { + var res : i32 = textureNumLayers(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLayers_ff5e89(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLayers_ff5e89(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLayers_ff5e89(); +} diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl new file mode 100644 index 0000000000..2782726f0c --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube; +fn textureNumLevels_076cb5() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_076cb5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_076cb5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_076cb5(); +} diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl new file mode 100644 index 0000000000..035660115d --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube arg_0 : register(t0, space1); + +void textureNumLevels_076cb5() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_076cb5(); + return; +} + +void fragment_main() { + textureNumLevels_076cb5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_076cb5(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl new file mode 100644 index 0000000000..32775720db --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_076cb5() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_076cb5(); + return; +} + +fragment void fragment_main() { + textureNumLevels_076cb5(); + return; +} + +kernel void compute_main() { + textureNumLevels_076cb5(); + return; +} + + +tint_aMtcrd.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm new file mode 100644 index 0000000000..c4b65d111b --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_076cb5 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_076cb5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_076cb5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_076cb5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl new file mode 100644 index 0000000000..42cfdbfe68 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/076cb5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube; + +fn textureNumLevels_076cb5() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_076cb5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_076cb5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_076cb5(); +} diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl new file mode 100644 index 0000000000..5f13a725fe --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +fn textureNumLevels_080d95() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_080d95(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_080d95(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_080d95(); +} diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl new file mode 100644 index 0000000000..bced17a33e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube arg_0 : register(t0, space1); + +void textureNumLevels_080d95() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_080d95(); + return; +} + +void fragment_main() { + textureNumLevels_080d95(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_080d95(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl new file mode 100644 index 0000000000..ac224810a4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_080d95() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_080d95(); + return; +} + +fragment void fragment_main() { + textureNumLevels_080d95(); + return; +} + +kernel void compute_main() { + textureNumLevels_080d95(); + return; +} + + +tint_zRq2iR.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm new file mode 100644 index 0000000000..76c0cb731d --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_080d95 "textureNumLevels_080d95" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_080d95 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_080d95 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_080d95 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_080d95 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl new file mode 100644 index 0000000000..b3582761fe --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/080d95.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureNumLevels_080d95() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_080d95(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_080d95(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_080d95(); +} diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl new file mode 100644 index 0000000000..9f5c5ddf54 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureNumLevels_09ddd0() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_09ddd0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_09ddd0(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_09ddd0(); +} diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl new file mode 100644 index 0000000000..ce4bd02d78 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D arg_0 : register(t0, space1); + +void textureNumLevels_09ddd0() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_09ddd0(); + return; +} + +void fragment_main() { + textureNumLevels_09ddd0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_09ddd0(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl new file mode 100644 index 0000000000..5411434b04 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_09ddd0() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_09ddd0(); + return; +} + +fragment void fragment_main() { + textureNumLevels_09ddd0(); + return; +} + +kernel void compute_main() { + textureNumLevels_09ddd0(); + return; +} + + +tint_VbPpyN.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm new file mode 100644 index 0000000000..83b255f9ac --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_09ddd0 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumLevels_09ddd0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumLevels_09ddd0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLevels_09ddd0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl new file mode 100644 index 0000000000..12ca9ff0d0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/09ddd0.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureNumLevels_09ddd0() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_09ddd0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_09ddd0(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_09ddd0(); +} diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl new file mode 100644 index 0000000000..e03ec03cb1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLevels_105988() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_105988(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_105988(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_105988(); +} diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl new file mode 100644 index 0000000000..5e0964440f --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLevels_105988() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_105988(); + return; +} + +void fragment_main() { + textureNumLevels_105988(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_105988(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl new file mode 100644 index 0000000000..d42d667a2b --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_105988() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_105988(); + return; +} + +fragment void fragment_main() { + textureNumLevels_105988(); + return; +} + +kernel void compute_main() { + textureNumLevels_105988(); + return; +} + + +tint_Orn2HY.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm new file mode 100644 index 0000000000..3bf9719d94 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_105988 "textureNumLevels_105988" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_105988 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_105988 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_105988 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_105988 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl new file mode 100644 index 0000000000..60b58b2a01 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/105988.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLevels_105988() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_105988(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_105988(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_105988(); +} diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl new file mode 100644 index 0000000000..41cc9ebf05 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureNumLevels_23f750() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_23f750(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_23f750(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_23f750(); +} diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl new file mode 100644 index 0000000000..54c42b182c --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D arg_0 : register(t0, space1); + +void textureNumLevels_23f750() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_23f750(); + return; +} + +void fragment_main() { + textureNumLevels_23f750(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_23f750(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl new file mode 100644 index 0000000000..de7be4f8f4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_23f750() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_23f750(); + return; +} + +fragment void fragment_main() { + textureNumLevels_23f750(); + return; +} + +kernel void compute_main() { + textureNumLevels_23f750(); + return; +} + + +tint_ne3mQQ.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm new file mode 100644 index 0000000000..0d83d808d7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_23f750 "textureNumLevels_23f750" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_23f750 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_23f750 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_23f750 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_23f750 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl new file mode 100644 index 0000000000..26ea98a171 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/23f750.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureNumLevels_23f750() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_23f750(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_23f750(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_23f750(); +} diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl new file mode 100644 index 0000000000..ff12574db9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube_array; +fn textureNumLevels_2c3575() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_2c3575(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_2c3575(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_2c3575(); +} diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl new file mode 100644 index 0000000000..0bd3455df8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLevels_2c3575() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_2c3575(); + return; +} + +void fragment_main() { + textureNumLevels_2c3575(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_2c3575(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl new file mode 100644 index 0000000000..11114313cc --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_2c3575() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_2c3575(); + return; +} + +fragment void fragment_main() { + textureNumLevels_2c3575(); + return; +} + +kernel void compute_main() { + textureNumLevels_2c3575(); + return; +} + + +tint_m6GLDO.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm new file mode 100644 index 0000000000..671ebe53a1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_2c3575 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_2c3575 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_2c3575 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_2c3575 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl new file mode 100644 index 0000000000..2cd56a5dd2 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/2c3575.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; + +fn textureNumLevels_2c3575() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_2c3575(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_2c3575(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_2c3575(); +} diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl new file mode 100644 index 0000000000..3aaae3866f --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLevels_5101cf() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_5101cf(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_5101cf(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_5101cf(); +} diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl new file mode 100644 index 0000000000..4e35f0d352 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLevels_5101cf() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_5101cf(); + return; +} + +void fragment_main() { + textureNumLevels_5101cf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_5101cf(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl new file mode 100644 index 0000000000..a457256ce9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_5101cf() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_5101cf(); + return; +} + +fragment void fragment_main() { + textureNumLevels_5101cf(); + return; +} + +kernel void compute_main() { + textureNumLevels_5101cf(); + return; +} + + +tint_m3uHe8.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm new file mode 100644 index 0000000000..3ec9308eb8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_5101cf "textureNumLevels_5101cf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_5101cf = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumLevels_5101cf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumLevels_5101cf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLevels_5101cf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl new file mode 100644 index 0000000000..fcb851af4a --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/5101cf.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLevels_5101cf() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_5101cf(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_5101cf(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_5101cf(); +} diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl new file mode 100644 index 0000000000..c56b159e8e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +fn textureNumLevels_897aaf() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_897aaf(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_897aaf(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_897aaf(); +} diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl new file mode 100644 index 0000000000..4b312a9a51 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube arg_0 : register(t0, space1); + +void textureNumLevels_897aaf() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_897aaf(); + return; +} + +void fragment_main() { + textureNumLevels_897aaf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_897aaf(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl new file mode 100644 index 0000000000..e6aea7e655 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_897aaf() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_897aaf(); + return; +} + +fragment void fragment_main() { + textureNumLevels_897aaf(); + return; +} + +kernel void compute_main() { + textureNumLevels_897aaf(); + return; +} + + +tint_qjfSAf.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm new file mode 100644 index 0000000000..f8da41f1dc --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_897aaf "textureNumLevels_897aaf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_897aaf = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_897aaf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_897aaf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_897aaf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl new file mode 100644 index 0000000000..e3ebba55f4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/897aaf.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureNumLevels_897aaf() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_897aaf(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_897aaf(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_897aaf(); +} diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl new file mode 100644 index 0000000000..d6a4013510 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureNumLevels_9da7a5() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_9da7a5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_9da7a5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_9da7a5(); +} diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl new file mode 100644 index 0000000000..9572320c76 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D arg_0 : register(t0, space1); + +void textureNumLevels_9da7a5() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_9da7a5(); + return; +} + +void fragment_main() { + textureNumLevels_9da7a5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_9da7a5(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl new file mode 100644 index 0000000000..401531a1db --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_9da7a5() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_9da7a5(); + return; +} + +fragment void fragment_main() { + textureNumLevels_9da7a5(); + return; +} + +kernel void compute_main() { + textureNumLevels_9da7a5(); + return; +} + + +tint_wbp3EV.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm new file mode 100644 index 0000000000..cf77846010 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_9da7a5 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_9da7a5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_9da7a5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_9da7a5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl new file mode 100644 index 0000000000..77ca44a2c4 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/9da7a5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureNumLevels_9da7a5() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_9da7a5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_9da7a5(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_9da7a5(); +} diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl new file mode 100644 index 0000000000..0647fbcc74 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLevels_a91c03() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_a91c03(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_a91c03(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_a91c03(); +} diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl new file mode 100644 index 0000000000..150bdad83e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLevels_a91c03() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_a91c03(); + return; +} + +void fragment_main() { + textureNumLevels_a91c03(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_a91c03(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl new file mode 100644 index 0000000000..8bc44fe226 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_a91c03() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_a91c03(); + return; +} + +fragment void fragment_main() { + textureNumLevels_a91c03(); + return; +} + +kernel void compute_main() { + textureNumLevels_a91c03(); + return; +} + + +tint_hG4QFz.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm new file mode 100644 index 0000000000..ad51d5b77e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_a91c03 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_a91c03 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_a91c03 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_a91c03 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl new file mode 100644 index 0000000000..3df9c9a981 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/a91c03.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLevels_a91c03() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_a91c03(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_a91c03(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_a91c03(); +} diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl new file mode 100644 index 0000000000..f7692cf51b --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLevels_aee7c8() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_aee7c8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_aee7c8(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_aee7c8(); +} diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl new file mode 100644 index 0000000000..72487b6041 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLevels_aee7c8() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_aee7c8(); + return; +} + +void fragment_main() { + textureNumLevels_aee7c8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_aee7c8(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl new file mode 100644 index 0000000000..c6d9be9eab --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_aee7c8() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_aee7c8(); + return; +} + +fragment void fragment_main() { + textureNumLevels_aee7c8(); + return; +} + +kernel void compute_main() { + textureNumLevels_aee7c8(); + return; +} + + +tint_uSNIsH.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm new file mode 100644 index 0000000000..69d6d18292 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_aee7c8 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_aee7c8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_aee7c8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_aee7c8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl new file mode 100644 index 0000000000..c962a084dc --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/aee7c8.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLevels_aee7c8() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_aee7c8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_aee7c8(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_aee7c8(); +} diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl new file mode 100644 index 0000000000..6973944319 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +fn textureNumLevels_b1b12b() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_b1b12b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_b1b12b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_b1b12b(); +} diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl new file mode 100644 index 0000000000..6ef32a8225 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D arg_0 : register(t0, space1); + +void textureNumLevels_b1b12b() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_b1b12b(); + return; +} + +void fragment_main() { + textureNumLevels_b1b12b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_b1b12b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl new file mode 100644 index 0000000000..dc3115832f --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_b1b12b() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_b1b12b(); + return; +} + +fragment void fragment_main() { + textureNumLevels_b1b12b(); + return; +} + +kernel void compute_main() { + textureNumLevels_b1b12b(); + return; +} + + +tint_fK8sGe.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm new file mode 100644 index 0000000000..38e86868dc --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_b1b12b = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_b1b12b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_b1b12b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_b1b12b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl new file mode 100644 index 0000000000..049e8fef3e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b1b12b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +fn textureNumLevels_b1b12b() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_b1b12b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_b1b12b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_b1b12b(); +} diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl new file mode 100644 index 0000000000..8a828c72a0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureNumLevels_b4f5ea() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_b4f5ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_b4f5ea(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_b4f5ea(); +} diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl new file mode 100644 index 0000000000..508d470a72 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D arg_0 : register(t0, space1); + +void textureNumLevels_b4f5ea() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_b4f5ea(); + return; +} + +void fragment_main() { + textureNumLevels_b4f5ea(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_b4f5ea(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl new file mode 100644 index 0000000000..e3b7eab9a9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_b4f5ea() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_b4f5ea(); + return; +} + +fragment void fragment_main() { + textureNumLevels_b4f5ea(); + return; +} + +kernel void compute_main() { + textureNumLevels_b4f5ea(); + return; +} + + +tint_kN6LIC.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm new file mode 100644 index 0000000000..7f154b620a --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_b4f5ea = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumLevels_b4f5ea + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumLevels_b4f5ea + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLevels_b4f5ea + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl new file mode 100644 index 0000000000..7039b9448d --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/b4f5ea.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureNumLevels_b4f5ea() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_b4f5ea(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_b4f5ea(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_b4f5ea(); +} diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl new file mode 100644 index 0000000000..03e60ce737 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +fn textureNumLevels_d004a9() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_d004a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_d004a9(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_d004a9(); +} diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl new file mode 100644 index 0000000000..50f47279d0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLevels_d004a9() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_d004a9(); + return; +} + +void fragment_main() { + textureNumLevels_d004a9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_d004a9(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl new file mode 100644 index 0000000000..36d75bb6e8 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_d004a9() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_d004a9(); + return; +} + +fragment void fragment_main() { + textureNumLevels_d004a9(); + return; +} + +kernel void compute_main() { + textureNumLevels_d004a9(); + return; +} + + +tint_J6mNNT.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm new file mode 100644 index 0000000000..2c1f0f84ae --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_d004a9 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_d004a9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_d004a9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_d004a9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl new file mode 100644 index 0000000000..725295989e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/d004a9.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +fn textureNumLevels_d004a9() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_d004a9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_d004a9(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_d004a9(); +} diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl new file mode 100644 index 0000000000..887a74dad6 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +fn textureNumLevels_dca09e() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_dca09e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_dca09e(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_dca09e(); +} diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl new file mode 100644 index 0000000000..c99f1f5226 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture3D arg_0 : register(t0, space1); + +void textureNumLevels_dca09e() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_dca09e(); + return; +} + +void fragment_main() { + textureNumLevels_dca09e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_dca09e(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl new file mode 100644 index 0000000000..22eaf18eec --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_dca09e() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_dca09e(); + return; +} + +fragment void fragment_main() { + textureNumLevels_dca09e(); + return; +} + +kernel void compute_main() { + textureNumLevels_dca09e(); + return; +} + + +tint_xvDrXY.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm new file mode 100644 index 0000000000..1df5c53b9b --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_dca09e "textureNumLevels_dca09e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_dca09e = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_dca09e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_dca09e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_dca09e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl new file mode 100644 index 0000000000..d4e4a04bc0 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/dca09e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +fn textureNumLevels_dca09e() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_dca09e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_dca09e(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_dca09e(); +} diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl new file mode 100644 index 0000000000..f8aca61ca9 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +fn textureNumLevels_e67231() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_e67231(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_e67231(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_e67231(); +} diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl new file mode 100644 index 0000000000..9650c5864d --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2D arg_0 : register(t0, space1); + +void textureNumLevels_e67231() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_e67231(); + return; +} + +void fragment_main() { + textureNumLevels_e67231(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_e67231(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl new file mode 100644 index 0000000000..5d2179418e --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_e67231() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_e67231(); + return; +} + +fragment void fragment_main() { + textureNumLevels_e67231(); + return; +} + +kernel void compute_main() { + textureNumLevels_e67231(); + return; +} + + +tint_qOzNfD.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm new file mode 100644 index 0000000000..cd2fa742ed --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_e67231 "textureNumLevels_e67231" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_e67231 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_e67231 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_e67231 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_e67231 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl new file mode 100644 index 0000000000..ec3dbc1252 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/e67231.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +fn textureNumLevels_e67231() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_e67231(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_e67231(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_e67231(); +} diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl new file mode 100644 index 0000000000..c4d793538f --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +fn textureNumLevels_ed078b() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_ed078b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_ed078b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_ed078b(); +} diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl new file mode 100644 index 0000000000..96fdcf83d1 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCube arg_0 : register(t0, space1); + +void textureNumLevels_ed078b() { + int3 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumLevels_ed078b(); + return; +} + +void fragment_main() { + textureNumLevels_ed078b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_ed078b(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl new file mode 100644 index 0000000000..95cc51a191 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_ed078b() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_ed078b(); + return; +} + +fragment void fragment_main() { + textureNumLevels_ed078b(); + return; +} + +kernel void compute_main() { + textureNumLevels_ed078b(); + return; +} + + +tint_mMDibi.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm new file mode 100644 index 0000000000..54f3ef5c89 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_ed078b "textureNumLevels_ed078b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_ed078b = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumLevels_ed078b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumLevels_ed078b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLevels_ed078b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl new file mode 100644 index 0000000000..cd4237da44 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/ed078b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +fn textureNumLevels_ed078b() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_ed078b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_ed078b(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_ed078b(); +} diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl new file mode 100644 index 0000000000..7f05b5cf78 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +fn textureNumLevels_f46ec6() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_f46ec6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_f46ec6(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_f46ec6(); +} diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl new file mode 100644 index 0000000000..a40d646a14 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +TextureCubeArray arg_0 : register(t0, space1); + +void textureNumLevels_f46ec6() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_f46ec6(); + return; +} + +void fragment_main() { + textureNumLevels_f46ec6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_f46ec6(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl new file mode 100644 index 0000000000..2d67f01176 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_f46ec6() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_f46ec6(); + return; +} + +fragment void fragment_main() { + textureNumLevels_f46ec6(); + return; +} + +kernel void compute_main() { + textureNumLevels_f46ec6(); + return; +} + + +tint_PqHlsD.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm new file mode 100644 index 0000000000..0a842b6853 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_f46ec6 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQueryLevels %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumLevels_f46ec6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumLevels_f46ec6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumLevels_f46ec6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl new file mode 100644 index 0000000000..fa0b57a9fb --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f46ec6.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +fn textureNumLevels_f46ec6() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_f46ec6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_f46ec6(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_f46ec6(); +} diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl new file mode 100644 index 0000000000..364f974837 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +fn textureNumLevels_f5828d() { + var res: i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_f5828d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_f5828d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_f5828d(); +} diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl new file mode 100644 index 0000000000..370e9e97c7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DArray arg_0 : register(t0, space1); + +void textureNumLevels_f5828d() { + int4 tint_tmp; + arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); + int res = tint_tmp.w; +} + +void vertex_main() { + textureNumLevels_f5828d(); + return; +} + +void fragment_main() { + textureNumLevels_f5828d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumLevels_f5828d(); + return; +} + diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl new file mode 100644 index 0000000000..49aebc89a3 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumLevels_f5828d() { + int res = int(arg_0.get_num_mip_levels()); +} + +vertex void vertex_main() { + textureNumLevels_f5828d(); + return; +} + +fragment void fragment_main() { + textureNumLevels_f5828d(); + return; +} + +kernel void compute_main() { + textureNumLevels_f5828d(); + return; +} + + +tint_loTxTw.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_mip_levels()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm new file mode 100644 index 0000000000..7691bf96f7 --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumLevels_f5828d "textureNumLevels_f5828d" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumLevels_f5828d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQueryLevels %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumLevels_f5828d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumLevels_f5828d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumLevels_f5828d + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl new file mode 100644 index 0000000000..560204079d --- /dev/null +++ b/test/intrinsics/gen/textureNumLevels/f5828d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +fn textureNumLevels_f5828d() { + var res : i32 = textureNumLevels(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumLevels_f5828d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumLevels_f5828d(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumLevels_f5828d(); +} diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl new file mode 100644 index 0000000000..1f161e56cd --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureNumSamples_2c6f14() { + var res: i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_2c6f14(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_2c6f14(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_2c6f14(); +} diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl new file mode 100644 index 0000000000..a304fa0c4c --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS arg_0 : register(t0, space1); + +void textureNumSamples_2c6f14() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumSamples_2c6f14(); + return; +} + +void fragment_main() { + textureNumSamples_2c6f14(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumSamples_2c6f14(); + return; +} + diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl new file mode 100644 index 0000000000..fddb2a82f2 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumSamples_2c6f14() { + int res = int(arg_0.get_num_samples()); +} + +vertex void vertex_main() { + textureNumSamples_2c6f14(); + return; +} + +fragment void fragment_main() { + textureNumSamples_2c6f14(); + return; +} + +kernel void compute_main() { + textureNumSamples_2c6f14(); + return; +} + + +tint_TdWxzV.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_samples()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm new file mode 100644 index 0000000000..3babdf6135 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumSamples_2c6f14 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %12 = OpImageQuerySamples %int %14 + OpStore %res %12 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumSamples_2c6f14 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumSamples_2c6f14 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumSamples_2c6f14 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl new file mode 100644 index 0000000000..f1f538bee2 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/2c6f14.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureNumSamples_2c6f14() { + var res : i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_2c6f14(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_2c6f14(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_2c6f14(); +} diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl new file mode 100644 index 0000000000..b29f0bdc08 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureNumSamples_42f8bb() { + var res: i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_42f8bb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_42f8bb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_42f8bb(); +} diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl new file mode 100644 index 0000000000..99a097360a --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS arg_0 : register(t0, space1); + +void textureNumSamples_42f8bb() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumSamples_42f8bb(); + return; +} + +void fragment_main() { + textureNumSamples_42f8bb(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumSamples_42f8bb(); + return; +} + diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl new file mode 100644 index 0000000000..616833cd9f --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumSamples_42f8bb() { + int res = int(arg_0.get_num_samples()); +} + +vertex void vertex_main() { + textureNumSamples_42f8bb(); + return; +} + +fragment void fragment_main() { + textureNumSamples_42f8bb(); + return; +} + +kernel void compute_main() { + textureNumSamples_42f8bb(); + return; +} + + +tint_Z8ljof.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_samples()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm new file mode 100644 index 0000000000..646c0b05ae --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %18 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumSamples_42f8bb = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %18 + %15 = OpLoad %7 %arg_0 + %13 = OpImageQuerySamples %int %15 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureNumSamples_42f8bb + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureNumSamples_42f8bb + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureNumSamples_42f8bb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl new file mode 100644 index 0000000000..bf84412fd6 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/42f8bb.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureNumSamples_42f8bb() { + var res : i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_42f8bb(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_42f8bb(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_42f8bb(); +} diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl new file mode 100644 index 0000000000..b92b2e4dd5 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_multisampled_2d; +fn textureNumSamples_449d23() { + var res: i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_449d23(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_449d23(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_449d23(); +} diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl new file mode 100644 index 0000000000..770966107c --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.hlsl @@ -0,0 +1,24 @@ +Texture2DMS arg_0 : register(t0, space1); + +void textureNumSamples_449d23() { + int3 tint_tmp; + arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); + int res = tint_tmp.z; +} + +void vertex_main() { + textureNumSamples_449d23(); + return; +} + +void fragment_main() { + textureNumSamples_449d23(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureNumSamples_449d23(); + return; +} + diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl new file mode 100644 index 0000000000..7f2566cd19 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureNumSamples_449d23() { + int res = int(arg_0.get_num_samples()); +} + +vertex void vertex_main() { + textureNumSamples_449d23(); + return; +} + +fragment void fragment_main() { + textureNumSamples_449d23(); + return; +} + +kernel void compute_main() { + textureNumSamples_449d23(); + return; +} + + +tint_gYoBhK.metal:5:17: error: use of undeclared identifier 'arg_0' + int res = int(arg_0.get_num_samples()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm new file mode 100644 index 0000000000..60f158a319 --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureNumSamples_449d23 "textureNumSamples_449d23" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void +%_ptr_Function_int = OpTypePointer Function %int + %17 = OpConstantNull %int + %float_1 = OpConstant %float 1 +%textureNumSamples_449d23 = OpFunction %void None %9 + %12 = OpLabel + %res = OpVariable %_ptr_Function_int Function %17 + %14 = OpLoad %7 %arg_0 + %13 = OpImageQuerySamples %int %14 + OpStore %res %13 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureNumSamples_449d23 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureNumSamples_449d23 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureNumSamples_449d23 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl new file mode 100644 index 0000000000..7c15b3e9ed --- /dev/null +++ b/test/intrinsics/gen/textureNumSamples/449d23.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : texture_multisampled_2d; + +fn textureNumSamples_449d23() { + var res : i32 = textureNumSamples(arg_0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureNumSamples_449d23(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureNumSamples_449d23(); +} + +[[stage(compute)]] +fn compute_main() { + textureNumSamples_449d23(); +} diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl new file mode 100644 index 0000000000..435d7f404c --- /dev/null +++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_02aa9b() { + var res: vec4 = textureSample(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_02aa9b(); +} diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl new file mode 100644 index 0000000000..d326424468 --- /dev/null +++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_02aa9b() { + float4 res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0)); +} + +void fragment_main() { + textureSample_02aa9b(); + return; +} + + +tint_O72GUO:5:43: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl new file mode 100644 index 0000000000..22a92aba45 --- /dev/null +++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_02aa9b() { + float4 res = arg_0.sample(arg_1, float2(), 1, int2()); +} + +fragment void fragment_main() { + textureSample_02aa9b(); + return; +} + + +tint_3llOQ2.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, int2()); + ^ +tint_3llOQ2.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm new file mode 100644 index 0000000000..53aa580476 --- /dev/null +++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_02aa9b "textureSample_02aa9b" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2int = OpTypeVector %int 2 + %24 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %27 = OpConstantNull %v4float +%textureSample_02aa9b = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %27 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %19 = OpConvertSToF %float %int_1 + %22 = OpCompositeConstruct %v3float %19 + %12 = OpImageSampleImplicitLod %v4float %17 %22 ConstOffset %24 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %29 = OpLabel + %30 = OpFunctionCall %void %textureSample_02aa9b + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %22 = OpCompositeConstruct %v3float %19 + diff --git a/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl new file mode 100644 index 0000000000..b005caac98 --- /dev/null +++ b/test/intrinsics/gen/textureSample/02aa9b.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_02aa9b() { + var res : vec4 = textureSample(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_02aa9b(); +} diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl b/test/intrinsics/gen/textureSample/100dc0.wgsl new file mode 100644 index 0000000000..4ced97ca33 --- /dev/null +++ b/test/intrinsics/gen/textureSample/100dc0.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_100dc0() { + var res: vec4 = textureSample(arg_0, arg_1, vec3(), vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_100dc0(); +} diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl new file mode 100644 index 0000000000..9f8134c262 --- /dev/null +++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_100dc0() { + float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0)); +} + +void fragment_main() { + textureSample_100dc0(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl new file mode 100644 index 0000000000..8bc14f40c8 --- /dev/null +++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_100dc0() { + float4 res = arg_0.sample(arg_1, float3(), int3()); +} + +fragment void fragment_main() { + textureSample_100dc0(); + return; +} + + +tint_Fkbrex.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), int3()); + ^ +tint_Fkbrex.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), int3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm new file mode 100644 index 0000000000..4639de28d3 --- /dev/null +++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_100dc0 "textureSample_100dc0" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %22 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float +%textureSample_100dc0 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 ConstOffset %22 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureSample_100dc0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl new file mode 100644 index 0000000000..6fcbb13e02 --- /dev/null +++ b/test/intrinsics/gen/textureSample/100dc0.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_100dc0() { + var res : vec4 = textureSample(arg_0, arg_1, vec3(), vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_100dc0(); +} diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl new file mode 100644 index 0000000000..1e7ad3b9a9 --- /dev/null +++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_38bbb9() { + var res: f32 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_38bbb9(); +} diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl new file mode 100644 index 0000000000..3cedaf27c7 --- /dev/null +++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_38bbb9() { + float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_38bbb9(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl new file mode 100644 index 0000000000..38eea196e7 --- /dev/null +++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_38bbb9() { + float res = arg_0.sample(arg_1, float2()); +} + +fragment void fragment_main() { + textureSample_38bbb9(); + return; +} + + +tint_fTMbcr.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2()); + ^ +tint_fTMbcr.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm new file mode 100644 index 0000000000..965b178b31 --- /dev/null +++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_38bbb9 "textureSample_38bbb9" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %20 = OpConstantNull %v2float +%_ptr_Function_float = OpTypePointer Function %float + %23 = OpConstantNull %float +%textureSample_38bbb9 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %23 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %13 = OpImageSampleImplicitLod %v4float %18 %20 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSample_38bbb9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl new file mode 100644 index 0000000000..3d321ed2a9 --- /dev/null +++ b/test/intrinsics/gen/textureSample/38bbb9.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_38bbb9() { + var res : f32 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_38bbb9(); +} diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl new file mode 100644 index 0000000000..fb13a0e555 --- /dev/null +++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_3b50bd() { + var res: vec4 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_3b50bd(); +} diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl new file mode 100644 index 0000000000..b14b6e56bb --- /dev/null +++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_3b50bd() { + float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_3b50bd(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl new file mode 100644 index 0000000000..1f171fe68c --- /dev/null +++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_3b50bd() { + float4 res = arg_0.sample(arg_1, float3()); +} + +fragment void fragment_main() { + textureSample_3b50bd(); + return; +} + + +tint_rGB6Up.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3()); + ^ +tint_rGB6Up.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm new file mode 100644 index 0000000000..c41cc4dcc8 --- /dev/null +++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.spvasm @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_3b50bd "textureSample_3b50bd" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %22 = OpConstantNull %v4float +%textureSample_3b50bd = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %22 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureSample_3b50bd + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl new file mode 100644 index 0000000000..268e4e4e7f --- /dev/null +++ b/test/intrinsics/gen/textureSample/3b50bd.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_3b50bd() { + var res : vec4 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_3b50bd(); +} diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl new file mode 100644 index 0000000000..0e9ecba274 --- /dev/null +++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_4dd1bf() { + var res: vec4 = textureSample(arg_0, arg_1, vec3(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_4dd1bf(); +} diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl new file mode 100644 index 0000000000..7cee1c7a03 --- /dev/null +++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_4dd1bf() { + float4 res = arg_0.Sample(arg_1, float4(float(1))); +} + +void fragment_main() { + textureSample_4dd1bf(); + return; +} + + +tint_KfNSDx:5:43: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.Sample(arg_1, float4(float(1))); + ^ + diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl new file mode 100644 index 0000000000..5a3b8c8864 --- /dev/null +++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_4dd1bf() { + float4 res = arg_0.sample(arg_1, float3(), 1); +} + +fragment void fragment_main() { + textureSample_4dd1bf(); + return; +} + + +tint_ULElO7.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), 1); + ^ +tint_ULElO7.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), 1); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm new file mode 100644 index 0000000000..3e5ee96c83 --- /dev/null +++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_4dd1bf "textureSample_4dd1bf" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %24 = OpConstantNull %v4float +%textureSample_4dd1bf = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %24 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %18 = OpConvertSToF %float %int_1 + %21 = OpCompositeConstruct %v4float %18 + %12 = OpImageSampleImplicitLod %v4float %17 %21 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureSample_4dd1bf + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %21 = OpCompositeConstruct %v4float %18 + diff --git a/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl new file mode 100644 index 0000000000..25c98d3b14 --- /dev/null +++ b/test/intrinsics/gen/textureSample/4dd1bf.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_4dd1bf() { + var res : vec4 = textureSample(arg_0, arg_1, vec3(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_4dd1bf(); +} diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl b/test/intrinsics/gen/textureSample/51b514.wgsl new file mode 100644 index 0000000000..f99e821ac0 --- /dev/null +++ b/test/intrinsics/gen/textureSample/51b514.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_51b514() { + var res: vec4 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_51b514(); +} diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl new file mode 100644 index 0000000000..a82f95fa7a --- /dev/null +++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_51b514() { + float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_51b514(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl new file mode 100644 index 0000000000..aa11503fd4 --- /dev/null +++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_51b514() { + float4 res = arg_0.sample(arg_1, float2()); +} + +fragment void fragment_main() { + textureSample_51b514(); + return; +} + + +tint_DjFmC0.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2()); + ^ +tint_DjFmC0.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm new file mode 100644 index 0000000000..a7f4db5ba1 --- /dev/null +++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.spvasm @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_51b514 "textureSample_51b514" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %19 = OpConstantNull %v2float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %22 = OpConstantNull %v4float +%textureSample_51b514 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %22 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureSample_51b514 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl new file mode 100644 index 0000000000..825becdb2c --- /dev/null +++ b/test/intrinsics/gen/textureSample/51b514.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_51b514() { + var res : vec4 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_51b514(); +} diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl b/test/intrinsics/gen/textureSample/667d76.wgsl new file mode 100644 index 0000000000..941d7b19c7 --- /dev/null +++ b/test/intrinsics/gen/textureSample/667d76.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_667d76() { + var res: f32 = textureSample(arg_0, arg_1, vec2(), vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_667d76(); +} diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl new file mode 100644 index 0000000000..b006a77ab0 --- /dev/null +++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_667d76() { + float res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0)); +} + +void fragment_main() { + textureSample_667d76(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl new file mode 100644 index 0000000000..f49d51cb4a --- /dev/null +++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_667d76() { + float res = arg_0.sample(arg_1, float2(), int2()); +} + +fragment void fragment_main() { + textureSample_667d76(); + return; +} + + +tint_Mx8eug.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), int2()); + ^ +tint_Mx8eug.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm new file mode 100644 index 0000000000..f813d47b26 --- /dev/null +++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_667d76 "textureSample_667d76" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %20 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %23 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %26 = OpConstantNull %float +%textureSample_667d76 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %26 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %13 = OpImageSampleImplicitLod %v4float %18 %20 ConstOffset %23 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSample_667d76 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl new file mode 100644 index 0000000000..3e92695b6b --- /dev/null +++ b/test/intrinsics/gen/textureSample/667d76.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_667d76() { + var res : f32 = textureSample(arg_0, arg_1, vec2(), vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_667d76(); +} diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl b/test/intrinsics/gen/textureSample/6717ca.wgsl new file mode 100644 index 0000000000..f4b3ab15d6 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6717ca.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_6717ca() { + var res: vec4 = textureSample(arg_0, arg_1, vec2(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_6717ca(); +} diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl new file mode 100644 index 0000000000..7215cbeb81 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_6717ca() { + float4 res = arg_0.Sample(arg_1, float3(float(1))); +} + +void fragment_main() { + textureSample_6717ca(); + return; +} + + +tint_0ZWvLf:5:43: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.Sample(arg_1, float3(float(1))); + ^ + diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl new file mode 100644 index 0000000000..6467e69161 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_6717ca() { + float4 res = arg_0.sample(arg_1, float2(), 1); +} + +fragment void fragment_main() { + textureSample_6717ca(); + return; +} + + +tint_u9HsAP.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1); + ^ +tint_u9HsAP.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm new file mode 100644 index 0000000000..0879b649f0 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_6717ca "textureSample_6717ca" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float +%textureSample_6717ca = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %19 = OpConvertSToF %float %int_1 + %22 = OpCompositeConstruct %v3float %19 + %12 = OpImageSampleImplicitLod %v4float %17 %22 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureSample_6717ca + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %22 = OpCompositeConstruct %v3float %19 + diff --git a/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl new file mode 100644 index 0000000000..9d9e6955a6 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6717ca.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_6717ca() { + var res : vec4 = textureSample(arg_0, arg_1, vec2(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_6717ca(); +} diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl new file mode 100644 index 0000000000..8a2dc06543 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_1d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_6e64fb() { + var res: vec4 = textureSample(arg_0, arg_1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_6e64fb(); +} diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl new file mode 100644 index 0000000000..3956953937 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture1D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_6e64fb() { + float4 res = arg_0.Sample(arg_1, 1.0f); +} + +void fragment_main() { + textureSample_6e64fb(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl new file mode 100644 index 0000000000..c09549831a --- /dev/null +++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_6e64fb() { + float4 res = arg_0.sample(arg_1, 1.0f); +} + +fragment void fragment_main() { + textureSample_6e64fb(); + return; +} + + +tint_Gw7uQt.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, 1.0f); + ^ +tint_Gw7uQt.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, 1.0f); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm new file mode 100644 index 0000000000..83a8589788 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.spvasm @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + OpCapability Sampled1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_6e64fb "textureSample_6e64fb" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 1D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %21 = OpConstantNull %v4float +%textureSample_6e64fb = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %21 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureSample_6e64fb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl new file mode 100644 index 0000000000..7e7d7ec2f6 --- /dev/null +++ b/test/intrinsics/gen/textureSample/6e64fb.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_1d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_6e64fb() { + var res : vec4 = textureSample(arg_0, arg_1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_6e64fb(); +} diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl new file mode 100644 index 0000000000..2c79264973 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_7c3baa() { + var res: vec4 = textureSample(arg_0, arg_1, vec2(), vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_7c3baa(); +} diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl new file mode 100644 index 0000000000..b3fbf8823a --- /dev/null +++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_7c3baa() { + float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f), int2(0, 0)); +} + +void fragment_main() { + textureSample_7c3baa(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl new file mode 100644 index 0000000000..232efb448d --- /dev/null +++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_7c3baa() { + float4 res = arg_0.sample(arg_1, float2(), int2()); +} + +fragment void fragment_main() { + textureSample_7c3baa(); + return; +} + + +tint_6J7fSq.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), int2()); + ^ +tint_6J7fSq.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm new file mode 100644 index 0000000000..fcc0c5194d --- /dev/null +++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_7c3baa "textureSample_7c3baa" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %19 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %22 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float +%textureSample_7c3baa = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 ConstOffset %22 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureSample_7c3baa + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl new file mode 100644 index 0000000000..74917629c8 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7c3baa.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_7c3baa() { + var res : vec4 = textureSample(arg_0, arg_1, vec2(), vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_7c3baa(); +} diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl new file mode 100644 index 0000000000..524197f47a --- /dev/null +++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_7e9ffd() { + var res: f32 = textureSample(arg_0, arg_1, vec2(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_7e9ffd(); +} diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl new file mode 100644 index 0000000000..26b25cc370 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.hlsl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_7e9ffd() { + float res = arg_0.Sample(arg_1, float3(float(1))); +} + +void fragment_main() { + textureSample_7e9ffd(); + return; +} + + +tint_RyRxHD:5:42: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.Sample(arg_1, float3(float(1))); + ^ +tint_RyRxHD:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Sample(arg_1, float3(float(1))); + ^ + diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl new file mode 100644 index 0000000000..d91c03d3a6 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_7e9ffd() { + float res = arg_0.sample(arg_1, float2(), 1); +} + +fragment void fragment_main() { + textureSample_7e9ffd(); + return; +} + + +tint_RtNcbu.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), 1); + ^ +tint_RtNcbu.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), 1); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm new file mode 100644 index 0000000000..3a249292d9 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_7e9ffd "textureSample_7e9ffd" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %26 = OpConstantNull %float +%textureSample_7e9ffd = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %26 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %20 = OpConvertSToF %float %int_1 + %23 = OpCompositeConstruct %v3float %20 + %13 = OpImageSampleImplicitLod %v4float %18 %23 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSample_7e9ffd + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %23 = OpCompositeConstruct %v3float %20 + diff --git a/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl new file mode 100644 index 0000000000..b5709403e7 --- /dev/null +++ b/test/intrinsics/gen/textureSample/7e9ffd.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_7e9ffd() { + var res : f32 = textureSample(arg_0, arg_1, vec2(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_7e9ffd(); +} diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl b/test/intrinsics/gen/textureSample/8522e7.wgsl new file mode 100644 index 0000000000..63ba7f3228 --- /dev/null +++ b/test/intrinsics/gen/textureSample/8522e7.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_8522e7() { + var res: f32 = textureSample(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_8522e7(); +} diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl new file mode 100644 index 0000000000..ff31c64231 --- /dev/null +++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.hlsl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_8522e7() { + float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0)); +} + +void fragment_main() { + textureSample_8522e7(); + return; +} + + +tint_jIHeES:5:42: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0)); + ^ +tint_jIHeES:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Sample(arg_1, float3(float(1)), int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl new file mode 100644 index 0000000000..6b7d61a078 --- /dev/null +++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_8522e7() { + float res = arg_0.sample(arg_1, float2(), 1, int2()); +} + +fragment void fragment_main() { + textureSample_8522e7(); + return; +} + + +tint_Dm6FKk.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), 1, int2()); + ^ +tint_Dm6FKk.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), 1, int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm new file mode 100644 index 0000000000..6df06c58d8 --- /dev/null +++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_8522e7 "textureSample_8522e7" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2int = OpTypeVector %int 2 + %25 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %28 = OpConstantNull %float +%textureSample_8522e7 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %28 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %20 = OpConvertSToF %float %int_1 + %23 = OpCompositeConstruct %v3float %20 + %13 = OpImageSampleImplicitLod %v4float %18 %23 ConstOffset %25 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureSample_8522e7 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %23 = OpCompositeConstruct %v3float %20 + diff --git a/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl new file mode 100644 index 0000000000..4133cdea77 --- /dev/null +++ b/test/intrinsics/gen/textureSample/8522e7.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_8522e7() { + var res : f32 = textureSample(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_8522e7(); +} diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl new file mode 100644 index 0000000000..6c66d7610e --- /dev/null +++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_external; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_bb81ce() { + var res: vec4 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_bb81ce(); +} diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl new file mode 100644 index 0000000000..97de4486f6 --- /dev/null +++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_bb81ce() { + float4 res = arg_0.Sample(arg_1, float2(0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_bb81ce(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl new file mode 100644 index 0000000000..e102e8cad3 --- /dev/null +++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_bb81ce() { + float4 res = arg_0.sample(arg_1, float2()); +} + +fragment void fragment_main() { + textureSample_bb81ce(); + return; +} + + +tint_fZQEeQ.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2()); + ^ +tint_fZQEeQ.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm new file mode 100644 index 0000000000..8f0cf04f03 --- /dev/null +++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.spvasm @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_bb81ce "textureSample_bb81ce" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %19 = OpConstantNull %v2float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %22 = OpConstantNull %v4float +%textureSample_bb81ce = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %22 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureSample_bb81ce + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl new file mode 100644 index 0000000000..b82de69ea5 --- /dev/null +++ b/test/intrinsics/gen/textureSample/bb81ce.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : external_texture; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_bb81ce() { + var res : vec4 = textureSample(arg_0, arg_1, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_bb81ce(); +} diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl new file mode 100644 index 0000000000..8a96b2af56 --- /dev/null +++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_c2f4e8() { + var res: f32 = textureSample(arg_0, arg_1, vec3(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_c2f4e8(); +} diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl new file mode 100644 index 0000000000..7a08bcde4a --- /dev/null +++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.hlsl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_c2f4e8() { + float res = arg_0.Sample(arg_1, float4(float(1))); +} + +void fragment_main() { + textureSample_c2f4e8(); + return; +} + + +tint_YC11Cc:5:42: error: too few elements in vector initialization (expected 4 elements, have 1) + float res = arg_0.Sample(arg_1, float4(float(1))); + ^ +tint_YC11Cc:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.Sample(arg_1, float4(float(1))); + ^ + diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl new file mode 100644 index 0000000000..5d00e0aef7 --- /dev/null +++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_c2f4e8() { + float res = arg_0.sample(arg_1, float3(), 1); +} + +fragment void fragment_main() { + textureSample_c2f4e8(); + return; +} + + +tint_yWQ2qq.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float3(), 1); + ^ +tint_yWQ2qq.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float3(), 1); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm new file mode 100644 index 0000000000..5d8ec28a8a --- /dev/null +++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_c2f4e8 "textureSample_c2f4e8" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %25 = OpConstantNull %float +%textureSample_c2f4e8 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %25 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %19 = OpConvertSToF %float %int_1 + %22 = OpCompositeConstruct %v4float %19 + %13 = OpImageSampleImplicitLod %v4float %18 %22 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureSample_c2f4e8 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %22 = OpCompositeConstruct %v4float %19 + diff --git a/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl new file mode 100644 index 0000000000..835f3c2a0e --- /dev/null +++ b/test/intrinsics/gen/textureSample/c2f4e8.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_c2f4e8() { + var res : f32 = textureSample(arg_0, arg_1, vec3(), 1); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_c2f4e8(); +} diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl b/test/intrinsics/gen/textureSample/e53267.wgsl new file mode 100644 index 0000000000..203f39d276 --- /dev/null +++ b/test/intrinsics/gen/textureSample/e53267.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_e53267() { + var res: vec4 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_e53267(); +} diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl new file mode 100644 index 0000000000..0c9416486f --- /dev/null +++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_e53267() { + float4 res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_e53267(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl new file mode 100644 index 0000000000..a27e241eda --- /dev/null +++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_e53267() { + float4 res = arg_0.sample(arg_1, float3()); +} + +fragment void fragment_main() { + textureSample_e53267(); + return; +} + + +tint_HSAV5Q.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3()); + ^ +tint_HSAV5Q.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm new file mode 100644 index 0000000000..814f3b677c --- /dev/null +++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.spvasm @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 26 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_e53267 "textureSample_e53267" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %22 = OpConstantNull %v4float +%textureSample_e53267 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %22 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureSample_e53267 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl new file mode 100644 index 0000000000..64f9da93a5 --- /dev/null +++ b/test/intrinsics/gen/textureSample/e53267.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_e53267() { + var res : vec4 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_e53267(); +} diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl b/test/intrinsics/gen/textureSample/ea7030.wgsl new file mode 100644 index 0000000000..a3b09c741e --- /dev/null +++ b/test/intrinsics/gen/textureSample/ea7030.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSample_ea7030() { + var res: f32 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_ea7030(); +} diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl new file mode 100644 index 0000000000..e77f8f2433 --- /dev/null +++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSample_ea7030() { + float res = arg_0.Sample(arg_1, float3(0.0f, 0.0f, 0.0f)); +} + +void fragment_main() { + textureSample_ea7030(); + return; +} + diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl new file mode 100644 index 0000000000..1a09ff00e8 --- /dev/null +++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSample_ea7030() { + float res = arg_0.sample(arg_1, float3()); +} + +fragment void fragment_main() { + textureSample_ea7030(); + return; +} + + +tint_hX4U1g.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float3()); + ^ +tint_hX4U1g.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm new file mode 100644 index 0000000000..6109222716 --- /dev/null +++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSample_ea7030 "textureSample_ea7030" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %17 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %20 = OpConstantNull %v3float +%_ptr_Function_float = OpTypePointer Function %float + %23 = OpConstantNull %float +%textureSample_ea7030 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %23 + %15 = OpLoad %7 %arg_1 + %16 = OpLoad %3 %arg_0 + %18 = OpSampledImage %17 %16 %15 + %13 = OpImageSampleImplicitLod %v4float %18 %20 + %12 = OpCompositeExtract %float %13 0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSample_ea7030 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl new file mode 100644 index 0000000000..580b0b0a89 --- /dev/null +++ b/test/intrinsics/gen/textureSample/ea7030.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSample_ea7030() { + var res : f32 = textureSample(arg_0, arg_1, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSample_ea7030(); +} diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl new file mode 100644 index 0000000000..d234856efc --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_53b9f7() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_53b9f7(); +} diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl new file mode 100644 index 0000000000..f5efca255a --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_53b9f7() { + float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); +} + +void fragment_main() { + textureSampleBias_53b9f7(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl new file mode 100644 index 0000000000..3ceac72050 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_53b9f7() { + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); +} + +fragment void fragment_main() { + textureSampleBias_53b9f7(); + return; +} + + +tint_fXClsP.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); + ^ +tint_fXClsP.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm new file mode 100644 index 0000000000..ff353231f9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_53b9f7 "textureSampleBias_53b9f7" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %23 = OpConstantNull %v4float +%textureSampleBias_53b9f7 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %23 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSampleBias_53b9f7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl new file mode 100644 index 0000000000..aaeec48293 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/53b9f7.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_53b9f7() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_53b9f7(); +} diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl new file mode 100644 index 0000000000..182ec27c6a --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_65ac50() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_65ac50(); +} diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl new file mode 100644 index 0000000000..1683e75007 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_65ac50() { + float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f, int2(0, 0)); +} + +void fragment_main() { + textureSampleBias_65ac50(); + return; +} + + +tint_faUSzc:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f, int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl new file mode 100644 index 0000000000..aa253728a6 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_65ac50() { + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2()); +} + +fragment void fragment_main() { + textureSampleBias_65ac50(); + return; +} + + +tint_VENNtZ.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2()); + ^ +tint_VENNtZ.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm new file mode 100644 index 0000000000..60b9040ca8 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_65ac50 "textureSampleBias_65ac50" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %v2int = OpTypeVector %int 2 + %25 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %28 = OpConstantNull %v4float +%textureSampleBias_65ac50 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %28 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %19 = OpConvertSToF %float %int_1 + %22 = OpCompositeConstruct %v3float %19 + %12 = OpImageSampleImplicitLod %v4float %17 %22 Bias|ConstOffset %float_1 %25 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureSampleBias_65ac50 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %22 = OpCompositeConstruct %v3float %19 + diff --git a/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl new file mode 100644 index 0000000000..915c1f4b6b --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/65ac50.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_65ac50() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_65ac50(); +} diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl new file mode 100644 index 0000000000..53fe0bd523 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_6a9113() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_6a9113(); +} diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl new file mode 100644 index 0000000000..62d816a47b --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_6a9113() { + float4 res = arg_0.SampleBias(arg_1, float2(0.0f, 0.0f), 1.0f); +} + +void fragment_main() { + textureSampleBias_6a9113(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl new file mode 100644 index 0000000000..e69609308e --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_6a9113() { + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f)); +} + +fragment void fragment_main() { + textureSampleBias_6a9113(); + return; +} + + +tint_n6HLQB.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f)); + ^ +tint_n6HLQB.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm new file mode 100644 index 0000000000..eb73824e72 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_6a9113 "textureSampleBias_6a9113" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %19 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %23 = OpConstantNull %v4float +%textureSampleBias_6a9113 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %23 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSampleBias_6a9113 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl new file mode 100644 index 0000000000..36043aabf0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/6a9113.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_6a9113() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_6a9113(); +} diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl new file mode 100644 index 0000000000..599748f783 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_80e579() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_80e579(); +} diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl new file mode 100644 index 0000000000..a0331fd08a --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_80e579() { + float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f); +} + +void fragment_main() { + textureSampleBias_80e579(); + return; +} + + +tint_QgQYLu:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleBias(arg_1, float3(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl new file mode 100644 index 0000000000..e1858876a0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_80e579() { + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f)); +} + +fragment void fragment_main() { + textureSampleBias_80e579(); + return; +} + + +tint_VVVRdp.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f)); + ^ +tint_VVVRdp.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, bias(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm new file mode 100644 index 0000000000..3ee8e568e0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_80e579 "textureSampleBias_80e579" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleBias_80e579 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %19 = OpConvertSToF %float %int_1 + %22 = OpCompositeConstruct %v3float %19 + %12 = OpImageSampleImplicitLod %v4float %17 %22 Bias %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleBias_80e579 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %22 = OpCompositeConstruct %v3float %19 + diff --git a/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl new file mode 100644 index 0000000000..6134ecb5bf --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/80e579.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_80e579() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_80e579(); +} diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl new file mode 100644 index 0000000000..38f6c357dd --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_81c19a() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_81c19a(); +} diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl new file mode 100644 index 0000000000..6377b9750f --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_81c19a() { + float4 res = arg_0.SampleBias(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0)); +} + +void fragment_main() { + textureSampleBias_81c19a(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl new file mode 100644 index 0000000000..3569b2b7e6 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_81c19a() { + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2()); +} + +fragment void fragment_main() { + textureSampleBias_81c19a(); + return; +} + + +tint_Zl326D.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2()); + ^ +tint_Zl326D.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), bias(1.0f), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm new file mode 100644 index 0000000000..84424e35ec --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_81c19a "textureSampleBias_81c19a" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %19 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %23 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleBias_81c19a = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias|ConstOffset %float_1 %23 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleBias_81c19a + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl new file mode 100644 index 0000000000..88ef14b1a4 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/81c19a.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_81c19a() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_81c19a(); +} diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl new file mode 100644 index 0000000000..0972d0a435 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_d3fa1b() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_d3fa1b(); +} diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl new file mode 100644 index 0000000000..07024970bf --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_d3fa1b() { + float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); +} + +void fragment_main() { + textureSampleBias_d3fa1b(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl new file mode 100644 index 0000000000..ee3b17b1ea --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_d3fa1b() { + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); +} + +fragment void fragment_main() { + textureSampleBias_d3fa1b(); + return; +} + + +tint_21BT87.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); + ^ +tint_21BT87.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm new file mode 100644 index 0000000000..563bd6364e --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_d3fa1b "textureSampleBias_d3fa1b" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %23 = OpConstantNull %v4float +%textureSampleBias_d3fa1b = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %23 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSampleBias_d3fa1b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl new file mode 100644 index 0000000000..40dc89e097 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/d3fa1b.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_d3fa1b() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_d3fa1b(); +} diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl new file mode 100644 index 0000000000..dfd971b4ff --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_df91bb() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_df91bb(); +} diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl new file mode 100644 index 0000000000..f6e85fc544 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_df91bb() { + float4 res = arg_0.SampleBias(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0)); +} + +void fragment_main() { + textureSampleBias_df91bb(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl new file mode 100644 index 0000000000..ca7248380f --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_df91bb() { + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3()); +} + +fragment void fragment_main() { + textureSampleBias_df91bb(); + return; +} + + +tint_Y31ZCA.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3()); + ^ +tint_Y31ZCA.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), bias(1.0f), int3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm new file mode 100644 index 0000000000..3b58d2d5b8 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_df91bb "textureSampleBias_df91bb" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %19 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %23 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleBias_df91bb = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %12 = OpImageSampleImplicitLod %v4float %17 %19 Bias|ConstOffset %float_1 %23 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleBias_df91bb + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl new file mode 100644 index 0000000000..c361dd70cc --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/df91bb.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_df91bb() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1.0, vec3()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_df91bb(); +} diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl new file mode 100644 index 0000000000..3ab4bd6422 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleBias_eed7c4() { + var res: vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_eed7c4(); +} diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl new file mode 100644 index 0000000000..06acc953a4 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleBias_eed7c4() { + float4 res = arg_0.SampleBias(arg_1, float4(float(1)), 1.0f); +} + +void fragment_main() { + textureSampleBias_eed7c4(); + return; +} + + +tint_NFwEG1:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleBias(arg_1, float4(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl new file mode 100644 index 0000000000..37c07b0003 --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleBias_eed7c4() { + float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f)); +} + +fragment void fragment_main() { + textureSampleBias_eed7c4(); + return; +} + + +tint_FJH9UG.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f)); + ^ +tint_FJH9UG.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), 1, bias(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm new file mode 100644 index 0000000000..4c1050eecb --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleBias_eed7c4 "textureSampleBias_eed7c4" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %16 = OpTypeSampledImage %3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float +%textureSampleBias_eed7c4 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %14 = OpLoad %7 %arg_1 + %15 = OpLoad %3 %arg_0 + %17 = OpSampledImage %16 %15 %14 + %18 = OpConvertSToF %float %int_1 + %21 = OpCompositeConstruct %v4float %18 + %12 = OpImageSampleImplicitLod %v4float %17 %21 Bias %float_1 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureSampleBias_eed7c4 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %21 = OpCompositeConstruct %v4float %18 + diff --git a/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl new file mode 100644 index 0000000000..c106d85d4f --- /dev/null +++ b/test/intrinsics/gen/textureSampleBias/eed7c4.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleBias_eed7c4() { + var res : vec4 = textureSampleBias(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleBias_eed7c4(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl new file mode 100644 index 0000000000..fb99c39d89 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_25fcd1() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_25fcd1(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl new file mode 100644 index 0000000000..c7283b284a --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_25fcd1() { + float res = arg_0.SampleCmpLevelZero(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0)); +} + +void fragment_main() { + textureSampleCompare_25fcd1(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl new file mode 100644 index 0000000000..91fa073c52 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_25fcd1() { + float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2()); +} + +fragment void fragment_main() { + textureSampleCompare_25fcd1(); + return; +} + + +tint_pEGMaq.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2()); + ^ +tint_pEGMaq.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float2(), 1.0f, int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm new file mode 100644 index 0000000000..dcf0ce63d0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.spvasm @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_25fcd1 "textureSampleCompare_25fcd1" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %18 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %23 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %26 = OpConstantNull %float +%textureSampleCompare_25fcd1 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %26 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod|ConstOffset %float_0 %23 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleCompare_25fcd1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl new file mode 100644 index 0000000000..7beb7ef788 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/25fcd1.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_25fcd1() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_25fcd1(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl new file mode 100644 index 0000000000..363f9e09c9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_3a5923() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_3a5923(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl new file mode 100644 index 0000000000..051a7fedc3 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +Texture2D arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_3a5923() { + float res = arg_0.SampleCmpLevelZero(arg_1, float2(0.0f, 0.0f), 1.0f); +} + +void fragment_main() { + textureSampleCompare_3a5923(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl new file mode 100644 index 0000000000..f47fc85aa3 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_3a5923() { + float res = arg_0.sample_compare(arg_1, float2(), 1.0f); +} + +fragment void fragment_main() { + textureSampleCompare_3a5923(); + return; +} + + +tint_VUn9yJ.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float2(), 1.0f); + ^ +tint_VUn9yJ.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float2(), 1.0f); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm new file mode 100644 index 0000000000..cba7c59c48 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_3a5923 "textureSampleCompare_3a5923" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v2float = OpTypeVector %float 2 + %18 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 +%_ptr_Function_float = OpTypePointer Function %float + %23 = OpConstantNull %float +%textureSampleCompare_3a5923 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %23 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod %float_0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSampleCompare_3a5923 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl new file mode 100644 index 0000000000..a002ef224d --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/3a5923.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_3a5923() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_3a5923(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl new file mode 100644 index 0000000000..bcc7e3a5b0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_63fb83() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_63fb83(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl new file mode 100644 index 0000000000..29d85bdccc --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.hlsl @@ -0,0 +1,12 @@ +TextureCube arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_63fb83() { + float res = arg_0.SampleCmpLevelZero(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); +} + +void fragment_main() { + textureSampleCompare_63fb83(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl new file mode 100644 index 0000000000..d3cbb77ee0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_63fb83() { + float res = arg_0.sample_compare(arg_1, float3(), 1.0f); +} + +fragment void fragment_main() { + textureSampleCompare_63fb83(); + return; +} + + +tint_GIZRbk.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float3(), 1.0f); + ^ +tint_GIZRbk.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float3(), 1.0f); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm new file mode 100644 index 0000000000..b030b86c9c --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.spvasm @@ -0,0 +1,49 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_63fb83 "textureSampleCompare_63fb83" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %18 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 +%_ptr_Function_float = OpTypePointer Function %float + %23 = OpConstantNull %float +%textureSampleCompare_63fb83 = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %23 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %12 = OpImageSampleDrefExplicitLod %float %16 %18 %float_1 Lod %float_0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureSampleCompare_63fb83 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl new file mode 100644 index 0000000000..622f9976d5 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/63fb83.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_63fb83() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_63fb83(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl new file mode 100644 index 0000000000..18d36e3b88 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_98b85c() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_98b85c(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl new file mode 100644 index 0000000000..46b286d96a --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_98b85c() { + float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f, int2(0, 0)); +} + +void fragment_main() { + textureSampleCompare_98b85c(); + return; +} + + +tint_A6uvj1:5:54: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f, int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl new file mode 100644 index 0000000000..bf33ddb556 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_98b85c() { + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2()); +} + +fragment void fragment_main() { + textureSampleCompare_98b85c(); + return; +} + + +tint_MYN6rp.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2()); + ^ +tint_MYN6rp.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f, int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm new file mode 100644 index 0000000000..c09a2bbc08 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.spvasm @@ -0,0 +1,62 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 32 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_98b85c "textureSampleCompare_98b85c" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 + %v2int = OpTypeVector %int 2 + %25 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %28 = OpConstantNull %float +%textureSampleCompare_98b85c = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %28 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %18 = OpConvertSToF %float %int_1 + %21 = OpCompositeConstruct %v3float %18 + %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod|ConstOffset %float_0 %25 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %30 = OpLabel + %31 = OpFunctionCall %void %textureSampleCompare_98b85c + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %21 = OpCompositeConstruct %v3float %18 + diff --git a/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl new file mode 100644 index 0000000000..6e6b107d88 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/98b85c.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_98b85c() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_98b85c(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl new file mode 100644 index 0000000000..4f8941986e --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube_array; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_a3ca7e() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_a3ca7e(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl new file mode 100644 index 0000000000..750b7d3e0a --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_a3ca7e() { + float res = arg_0.SampleCmpLevelZero(arg_1, float4(float(1)), 1.0f); +} + +void fragment_main() { + textureSampleCompare_a3ca7e(); + return; +} + + +tint_IPHMMc:5:54: error: too few elements in vector initialization (expected 4 elements, have 1) + float res = arg_0.SampleCmpLevelZero(arg_1, float4(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl new file mode 100644 index 0000000000..7b6911325e --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_a3ca7e() { + float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f); +} + +fragment void fragment_main() { + textureSampleCompare_a3ca7e(); + return; +} + + +tint_9kTJOr.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f); + ^ +tint_9kTJOr.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float3(), 1, 1.0f); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm new file mode 100644 index 0000000000..a5d0103211 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_a3ca7e "textureSampleCompare_a3ca7e" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float Cube 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v4float = OpTypeVector %float 4 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 +%_ptr_Function_float = OpTypePointer Function %float + %26 = OpConstantNull %float +%textureSampleCompare_a3ca7e = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %26 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %18 = OpConvertSToF %float %int_1 + %21 = OpCompositeConstruct %v4float %18 + %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod %float_0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleCompare_a3ca7e + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %21 = OpCompositeConstruct %v4float %18 + diff --git a/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl new file mode 100644 index 0000000000..2d8f4b1626 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/a3ca7e.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_a3ca7e() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_a3ca7e(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl new file mode 100644 index 0000000000..ec52adf7ba --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl @@ -0,0 +1,34 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler_comparison; +fn textureSampleCompare_dd431d() { + var res: f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_dd431d(); +} diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl new file mode 100644 index 0000000000..7c0e10b9d1 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerComparisonState arg_1 : register(s1, space1); + +void textureSampleCompare_dd431d() { + float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f); +} + +void fragment_main() { + textureSampleCompare_dd431d(); + return; +} + + +tint_7sR8gj:5:54: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleCmpLevelZero(arg_1, float3(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl new file mode 100644 index 0000000000..21ecff4cdc --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.msl @@ -0,0 +1,25 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleCompare_dd431d() { + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f); +} + +fragment void fragment_main() { + textureSampleCompare_dd431d(); + return; +} + + +tint_QVzgbg.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f); + ^ +tint_QVzgbg.metal:5:36: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample_compare(arg_1, float2(), 1, 1.0f); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm new file mode 100644 index 0000000000..b5642d7654 --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleCompare_dd431d "textureSampleCompare_dd431d" + OpName %res "res" + OpName %fragment_main "fragment_main" + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 + %3 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_3 = OpTypePointer UniformConstant %3 + %arg_0 = OpVariable %_ptr_UniformConstant_3 UniformConstant + %7 = OpTypeSampler +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_1 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %15 = OpTypeSampledImage %3 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %float_0 = OpConstant %float 0 +%_ptr_Function_float = OpTypePointer Function %float + %26 = OpConstantNull %float +%textureSampleCompare_dd431d = OpFunction %void None %8 + %11 = OpLabel + %res = OpVariable %_ptr_Function_float Function %26 + %13 = OpLoad %7 %arg_1 + %14 = OpLoad %3 %arg_0 + %16 = OpSampledImage %15 %14 %13 + %18 = OpConvertSToF %float %int_1 + %21 = OpCompositeConstruct %v3float %18 + %12 = OpImageSampleDrefExplicitLod %float %16 %21 %float_1 Lod %float_0 + OpStore %res %12 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureSampleCompare_dd431d + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %21 = OpCompositeConstruct %v3float %18 + diff --git a/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl new file mode 100644 index 0000000000..8a292ade2e --- /dev/null +++ b/test/intrinsics/gen/textureSampleCompare/dd431d.wgsl.expected.wgsl @@ -0,0 +1,12 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler_comparison; + +fn textureSampleCompare_dd431d() { + var res : f32 = textureSampleCompare(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleCompare_dd431d(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl new file mode 100644 index 0000000000..9ed9baebd5 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_21402b() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_21402b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_21402b(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_21402b(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl new file mode 100644 index 0000000000..5ad324ff28 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_21402b() { + float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + textureSampleGrad_21402b(); + return; +} + +void fragment_main() { + textureSampleGrad_21402b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_21402b(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl new file mode 100644 index 0000000000..57728da442 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_21402b() { + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3())); +} + +vertex void vertex_main() { + textureSampleGrad_21402b(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_21402b(); + return; +} + +kernel void compute_main() { + textureSampleGrad_21402b(); + return; +} + + +tint_A4BTTm.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3())); + ^ +tint_A4BTTm.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3())); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm new file mode 100644 index 0000000000..0241ae0dfa --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_21402b "textureSampleGrad_21402b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_21402b = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %27 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleGrad_21402b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleGrad_21402b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleGrad_21402b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl new file mode 100644 index 0000000000..59d954e9fc --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/21402b.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_21402b() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_21402b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_21402b(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_21402b(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl new file mode 100644 index 0000000000..009ad75f04 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_2ecd8f() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec2(), 1, vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_2ecd8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_2ecd8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_2ecd8f(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl new file mode 100644 index 0000000000..056e2eac97 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_2ecd8f() { + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + textureSampleGrad_2ecd8f(); + return; +} + +void fragment_main() { + textureSampleGrad_2ecd8f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_2ecd8f(); + return; +} + + +tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^ + + +tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^ + + +tint_Qg4FBC:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); + ^ + diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl new file mode 100644 index 0000000000..97ce44841f --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_2ecd8f() { + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2())); +} + +vertex void vertex_main() { + textureSampleGrad_2ecd8f(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_2ecd8f(); + return; +} + +kernel void compute_main() { + textureSampleGrad_2ecd8f(); + return; +} + + +tint_sLu7kk.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2())); + ^ +tint_sLu7kk.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2())); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm new file mode 100644 index 0000000000..5b3a1db386 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.spvasm @@ -0,0 +1,83 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_2ecd8f "textureSampleGrad_2ecd8f" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2float = OpTypeVector %float 2 + %27 = OpConstantNull %v2float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %30 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_2ecd8f = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %30 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %22 = OpConvertSToF %float %int_1 + %25 = OpCompositeConstruct %v3float %22 + %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad %27 %27 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %32 = OpLabel + OpStore %tint_pointsize %float_1 + %34 = OpFunctionCall %void %textureSampleGrad_2ecd8f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %36 = OpLabel + %37 = OpFunctionCall %void %textureSampleGrad_2ecd8f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %39 = OpLabel + %40 = OpFunctionCall %void %textureSampleGrad_2ecd8f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %25 = OpCompositeConstruct %v3float %22 + diff --git a/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl new file mode 100644 index 0000000000..eba29dfafc --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/2ecd8f.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_2ecd8f() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec2(), 1, vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_2ecd8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_2ecd8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_2ecd8f(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl new file mode 100644 index 0000000000..2c535b9884 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_468f88() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec2(), vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_468f88(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_468f88(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_468f88(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl new file mode 100644 index 0000000000..912a6da3e6 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_468f88() { + float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); +} + +void vertex_main() { + textureSampleGrad_468f88(); + return; +} + +void fragment_main() { + textureSampleGrad_468f88(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_468f88(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl new file mode 100644 index 0000000000..984a782f59 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_468f88() { + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2()); +} + +vertex void vertex_main() { + textureSampleGrad_468f88(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_468f88(); + return; +} + +kernel void compute_main() { + textureSampleGrad_468f88(); + return; +} + + +tint_doTaaj.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2()); + ^ +tint_doTaaj.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2()), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm new file mode 100644 index 0000000000..c112502e88 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_468f88 "textureSampleGrad_468f88" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %22 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %25 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %28 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_468f88 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %28 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleGrad_468f88 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleGrad_468f88 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleGrad_468f88 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl new file mode 100644 index 0000000000..3d447deb06 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/468f88.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_468f88() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec2(), vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_468f88(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_468f88(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_468f88(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl new file mode 100644 index 0000000000..bd953b6962 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_521263() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_521263(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_521263(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_521263(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl new file mode 100644 index 0000000000..e8774371b5 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_521263() { + float4 res = arg_0.SampleGrad(arg_1, float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f)); +} + +void vertex_main() { + textureSampleGrad_521263(); + return; +} + +void fragment_main() { + textureSampleGrad_521263(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_521263(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl new file mode 100644 index 0000000000..8991aad3e2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_521263() { + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2())); +} + +vertex void vertex_main() { + textureSampleGrad_521263(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_521263(); + return; +} + +kernel void compute_main() { + textureSampleGrad_521263(); + return; +} + + +tint_WUNBbn.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2())); + ^ +tint_WUNBbn.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), gradient2d(float2(), float2())); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm new file mode 100644 index 0000000000..daa1cf8712 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_521263 "textureSampleGrad_521263" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %22 = OpConstantNull %v2float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_521263 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %27 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleGrad_521263 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleGrad_521263 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleGrad_521263 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl new file mode 100644 index 0000000000..283882bc95 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/521263.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_521263() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_521263(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_521263(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_521263(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl new file mode 100644 index 0000000000..e8f8c81a44 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_5312f4() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_5312f4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_5312f4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_5312f4(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl new file mode 100644 index 0000000000..add7e2596d --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_5312f4() { + float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + textureSampleGrad_5312f4(); + return; +} + +void fragment_main() { + textureSampleGrad_5312f4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_5312f4(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl new file mode 100644 index 0000000000..e1c12534cd --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_5312f4() { + float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3())); +} + +vertex void vertex_main() { + textureSampleGrad_5312f4(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_5312f4(); + return; +} + +kernel void compute_main() { + textureSampleGrad_5312f4(); + return; +} + + +tint_ktuoWy.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3())); + ^ +tint_ktuoWy.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), gradientcube(float3(), float3())); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm new file mode 100644 index 0000000000..018f69ada0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_5312f4 "textureSampleGrad_5312f4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %25 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_5312f4 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %25 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad %22 %22 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %27 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleGrad_5312f4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleGrad_5312f4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleGrad_5312f4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl new file mode 100644 index 0000000000..fe32c14134 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/5312f4.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_5312f4() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_5312f4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_5312f4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_5312f4(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl new file mode 100644 index 0000000000..3c64ddaaeb --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_872f00() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec2(), 1, vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_872f00(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_872f00(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_872f00(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl new file mode 100644 index 0000000000..c777f65ac9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_872f00() { + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); +} + +void vertex_main() { + textureSampleGrad_872f00(); + return; +} + +void fragment_main() { + textureSampleGrad_872f00(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_872f00(); + return; +} + + +tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); + ^ + + +tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); + ^ + + +tint_TQAGnF:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float3(float(1)), float2(0.0f, 0.0f), float2(0.0f, 0.0f), int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl new file mode 100644 index 0000000000..57e6ed3928 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_872f00() { + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2()); +} + +vertex void vertex_main() { + textureSampleGrad_872f00(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_872f00(); + return; +} + +kernel void compute_main() { + textureSampleGrad_872f00(); + return; +} + + +tint_9yqds2.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2()); + ^ +tint_9yqds2.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, gradient2d(float2(), float2()), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm new file mode 100644 index 0000000000..b9742e470d --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.spvasm @@ -0,0 +1,85 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 43 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_872f00 "textureSampleGrad_872f00" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2float = OpTypeVector %float 2 + %27 = OpConstantNull %v2float + %v2int = OpTypeVector %int 2 + %29 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %32 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_872f00 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %32 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %22 = OpConvertSToF %float %int_1 + %25 = OpCompositeConstruct %v3float %22 + %15 = OpImageSampleExplicitLod %v4float %20 %25 Grad|ConstOffset %27 %27 %29 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %34 = OpLabel + OpStore %tint_pointsize %float_1 + %36 = OpFunctionCall %void %textureSampleGrad_872f00 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleGrad_872f00 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %41 = OpLabel + %42 = OpFunctionCall %void %textureSampleGrad_872f00 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %25 = OpCompositeConstruct %v3float %22 + diff --git a/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl new file mode 100644 index 0000000000..1519468626 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/872f00.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_872f00() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec2(), 1, vec2(), vec2(), vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_872f00(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_872f00(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_872f00(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl new file mode 100644 index 0000000000..dd1843cb33 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_e383db() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec3(), 1, vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_e383db(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_e383db(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_e383db(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl new file mode 100644 index 0000000000..48246760c2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_e383db() { + float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + textureSampleGrad_e383db(); + return; +} + +void fragment_main() { + textureSampleGrad_e383db(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_e383db(); + return; +} + + +tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^ + + +tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^ + + +tint_fHKVHJ:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleGrad(arg_1, float4(float(1)), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f)); + ^ + diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl new file mode 100644 index 0000000000..12a18a8720 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_e383db() { + float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3())); +} + +vertex void vertex_main() { + textureSampleGrad_e383db(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_e383db(); + return; +} + +kernel void compute_main() { + textureSampleGrad_e383db(); + return; +} + + +tint_2um7ce.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3())); + ^ +tint_2um7ce.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), 1, gradientcube(float3(), float3())); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm new file mode 100644 index 0000000000..62e786b89c --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.spvasm @@ -0,0 +1,83 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_e383db "textureSampleGrad_e383db" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v3float = OpTypeVector %float 3 + %26 = OpConstantNull %v3float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %29 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_e383db = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %29 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %21 = OpConvertSToF %float %int_1 + %24 = OpCompositeConstruct %v4float %21 + %15 = OpImageSampleExplicitLod %v4float %20 %24 Grad %26 %26 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %31 = OpLabel + OpStore %tint_pointsize %float_1 + %33 = OpFunctionCall %void %textureSampleGrad_e383db + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %35 = OpLabel + %36 = OpFunctionCall %void %textureSampleGrad_e383db + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleGrad_e383db + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %24 = OpCompositeConstruct %v4float %21 + diff --git a/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl new file mode 100644 index 0000000000..a528a162a7 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e383db.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_e383db() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec3(), 1, vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_e383db(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_e383db(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_e383db(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl new file mode 100644 index 0000000000..0570dd9d5b --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleGrad_e9a2f7() { + var res: vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_e9a2f7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_e9a2f7(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_e9a2f7(); +} diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl new file mode 100644 index 0000000000..aeb94451f3 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleGrad_e9a2f7() { + float4 res = arg_0.SampleGrad(arg_1, float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), int3(0, 0, 0)); +} + +void vertex_main() { + textureSampleGrad_e9a2f7(); + return; +} + +void fragment_main() { + textureSampleGrad_e9a2f7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleGrad_e9a2f7(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl new file mode 100644 index 0000000000..a0423e84a0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleGrad_e9a2f7() { + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3()); +} + +vertex void vertex_main() { + textureSampleGrad_e9a2f7(); + return; +} + +fragment void fragment_main() { + textureSampleGrad_e9a2f7(); + return; +} + +kernel void compute_main() { + textureSampleGrad_e9a2f7(); + return; +} + + +tint_XTrY0h.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3()); + ^ +tint_XTrY0h.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), gradient3d(float3(), float3()), int3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm new file mode 100644 index 0000000000..e523af4594 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleGrad_e9a2f7 "textureSampleGrad_e9a2f7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %25 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %28 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleGrad_e9a2f7 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %28 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Grad|ConstOffset %22 %22 %25 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleGrad_e9a2f7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl new file mode 100644 index 0000000000..e92d43a021 --- /dev/null +++ b/test/intrinsics/gen/textureSampleGrad/e9a2f7.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleGrad_e9a2f7() { + var res : vec4 = textureSampleGrad(arg_0, arg_1, vec3(), vec3(), vec3(), vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleGrad_e9a2f7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleGrad_e9a2f7(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleGrad_e9a2f7(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl new file mode 100644 index 0000000000..b557f04c25 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_02be59() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_02be59(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_02be59(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_02be59(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl new file mode 100644 index 0000000000..e67e8af3c9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_02be59() { + float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1); +} + +void vertex_main() { + textureSampleLevel_02be59(); + return; +} + +void fragment_main() { + textureSampleLevel_02be59(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_02be59(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl new file mode 100644 index 0000000000..2f21bc3077 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_02be59() { + float res = arg_0.sample(arg_1, float2(), level(1)); +} + +vertex void vertex_main() { + textureSampleLevel_02be59(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_02be59(); + return; +} + +kernel void compute_main() { + textureSampleLevel_02be59(); + return; +} + + +tint_MlSwdA.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), level(1)); + ^ +tint_MlSwdA.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), level(1)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm new file mode 100644 index 0000000000..de6563c09a --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_02be59 "textureSampleLevel_02be59" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %23 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_02be59 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %24 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_02be59 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_02be59 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_02be59 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl new file mode 100644 index 0000000000..c2f0d11a26 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/02be59.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_02be59() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_02be59(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_02be59(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_02be59(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl new file mode 100644 index 0000000000..d7dd70b1e8 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_0bdd9a() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_0bdd9a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_0bdd9a(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_0bdd9a(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl new file mode 100644 index 0000000000..f81fbbb019 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_0bdd9a() { + float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f); +} + +void vertex_main() { + textureSampleLevel_0bdd9a(); + return; +} + +void fragment_main() { + textureSampleLevel_0bdd9a(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_0bdd9a(); + return; +} + + +tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f); + ^ + + +tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f); + ^ + + +tint_QjIcR9:5:48: error: too few elements in vector initialization (expected 4 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float4(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl new file mode 100644 index 0000000000..6880ef209a --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_0bdd9a() { + float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_0bdd9a(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_0bdd9a(); + return; +} + +kernel void compute_main() { + textureSampleLevel_0bdd9a(); + return; +} + + +tint_y7pPKt.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f)); + ^ +tint_y7pPKt.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), 1, level(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm new file mode 100644 index 0000000000..cc17e0552e --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.spvasm @@ -0,0 +1,81 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 38 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_0bdd9a "textureSampleLevel_0bdd9a" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %28 = OpConstantNull %v4float +%textureSampleLevel_0bdd9a = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %28 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %21 = OpConvertSToF %float %int_1 + %24 = OpCompositeConstruct %v4float %21 + %15 = OpImageSampleExplicitLod %v4float %20 %24 Lod %float_1 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %31 = OpFunctionCall %void %textureSampleLevel_0bdd9a + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %33 = OpLabel + %34 = OpFunctionCall %void %textureSampleLevel_0bdd9a + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %36 = OpLabel + %37 = OpFunctionCall %void %textureSampleLevel_0bdd9a + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %24 = OpCompositeConstruct %v4float %21 + diff --git a/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl new file mode 100644 index 0000000000..1e77805245 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/0bdd9a.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_0bdd9a() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_0bdd9a(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_0bdd9a(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_0bdd9a(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl new file mode 100644 index 0000000000..e983a8c4cc --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_1b0291() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_1b0291(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_1b0291(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_1b0291(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl new file mode 100644 index 0000000000..dd4acbfeaa --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_1b0291() { + float res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1); +} + +void vertex_main() { + textureSampleLevel_1b0291(); + return; +} + +void fragment_main() { + textureSampleLevel_1b0291(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_1b0291(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl new file mode 100644 index 0000000000..da76cd6e3c --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_1b0291() { + float res = arg_0.sample(arg_1, float3(), level(1)); +} + +vertex void vertex_main() { + textureSampleLevel_1b0291(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_1b0291(); + return; +} + +kernel void compute_main() { + textureSampleLevel_1b0291(); + return; +} + + +tint_i62KS7.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float3(), level(1)); + ^ +tint_i62KS7.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float3(), level(1)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm new file mode 100644 index 0000000000..a0202c2e06 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_1b0291 "textureSampleLevel_1b0291" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %23 = OpConstantNull %v3float + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_1b0291 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %24 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod %24 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_1b0291 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_1b0291 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_1b0291 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl new file mode 100644 index 0000000000..e24aebbbfa --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1b0291.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_1b0291() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec3(), 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_1b0291(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_1b0291(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_1b0291(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl new file mode 100644 index 0000000000..cbb37ce58a --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_1bf73e() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_1bf73e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_1bf73e(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_1bf73e(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl new file mode 100644 index 0000000000..adfe0a7374 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.hlsl @@ -0,0 +1,52 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_1bf73e() { + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); +} + +void vertex_main() { + textureSampleLevel_1bf73e(); + return; +} + +void fragment_main() { + textureSampleLevel_1bf73e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_1bf73e(); + return; +} + + +tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ +tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ + + +tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ +tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ + + +tint_U83SMG:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ +tint_U83SMG:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl new file mode 100644 index 0000000000..c5e9d5aef2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_1bf73e() { + float res = arg_0.sample(arg_1, float2(), 1, level(1)); +} + +vertex void vertex_main() { + textureSampleLevel_1bf73e(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_1bf73e(); + return; +} + +kernel void compute_main() { + textureSampleLevel_1bf73e(); + return; +} + + +tint_tekcGc.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), 1, level(1)); + ^ +tint_tekcGc.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), 1, level(1)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm new file mode 100644 index 0000000000..39175d82de --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.spvasm @@ -0,0 +1,82 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 40 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_1bf73e "textureSampleLevel_1bf73e" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_1bf73e = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %23 = OpConvertSToF %float %int_1 + %26 = OpCompositeConstruct %v3float %23 + %27 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod %27 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %31 = OpLabel + OpStore %tint_pointsize %float_1 + %33 = OpFunctionCall %void %textureSampleLevel_1bf73e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %35 = OpLabel + %36 = OpFunctionCall %void %textureSampleLevel_1bf73e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %38 = OpLabel + %39 = OpFunctionCall %void %textureSampleLevel_1bf73e + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %26 = OpCompositeConstruct %v3float %23 + diff --git a/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl new file mode 100644 index 0000000000..c76783b648 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/1bf73e.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_1bf73e() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_1bf73e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_1bf73e(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_1bf73e(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl new file mode 100644 index 0000000000..8c7e833df1 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_302be4() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_302be4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_302be4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_302be4(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl new file mode 100644 index 0000000000..bcca58d683 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_302be4() { + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f); +} + +void vertex_main() { + textureSampleLevel_302be4(); + return; +} + +void fragment_main() { + textureSampleLevel_302be4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_302be4(); + return; +} + + +tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f); + ^ + + +tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f); + ^ + + +tint_wKzugP:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl new file mode 100644 index 0000000000..06532a11cf --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_302be4() { + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_302be4(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_302be4(); + return; +} + +kernel void compute_main() { + textureSampleLevel_302be4(); + return; +} + + +tint_tJxVCK.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f)); + ^ +tint_tJxVCK.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm new file mode 100644 index 0000000000..1569494795 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.spvasm @@ -0,0 +1,81 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_302be4 "textureSampleLevel_302be4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %29 = OpConstantNull %v4float +%textureSampleLevel_302be4 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %29 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %22 = OpConvertSToF %float %int_1 + %25 = OpCompositeConstruct %v3float %22 + %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod %float_1 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %31 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_302be4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_302be4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_302be4 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %25 = OpCompositeConstruct %v3float %22 + diff --git a/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl new file mode 100644 index 0000000000..e2c86f1e7e --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/302be4.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_302be4() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_302be4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_302be4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_302be4(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl new file mode 100644 index 0000000000..20c5d2dc0b --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_47daa4() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_47daa4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_47daa4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_47daa4(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl new file mode 100644 index 0000000000..1fa7f9101e --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_47daa4() { + float res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1, int2(0, 0)); +} + +void vertex_main() { + textureSampleLevel_47daa4(); + return; +} + +void fragment_main() { + textureSampleLevel_47daa4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_47daa4(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl new file mode 100644 index 0000000000..62a1918bc3 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_47daa4() { + float res = arg_0.sample(arg_1, float2(), level(1), int2()); +} + +vertex void vertex_main() { + textureSampleLevel_47daa4(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_47daa4(); + return; +} + +kernel void compute_main() { + textureSampleLevel_47daa4(); + return; +} + + +tint_NueDXP.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), level(1), int2()); + ^ +tint_NueDXP.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), level(1), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm new file mode 100644 index 0000000000..237ca8a67e --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.spvasm @@ -0,0 +1,75 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_47daa4 "textureSampleLevel_47daa4" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %23 = OpConstantNull %v2float + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2int = OpTypeVector %int 2 + %28 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_47daa4 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %24 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %23 Lod|ConstOffset %24 %28 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %32 = OpLabel + OpStore %tint_pointsize %float_1 + %34 = OpFunctionCall %void %textureSampleLevel_47daa4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %36 = OpLabel + %37 = OpFunctionCall %void %textureSampleLevel_47daa4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %39 = OpLabel + %40 = OpFunctionCall %void %textureSampleLevel_47daa4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl new file mode 100644 index 0000000000..7c3690fcad --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/47daa4.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_47daa4() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_47daa4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_47daa4(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_47daa4(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl new file mode 100644 index 0000000000..17be2cb309 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_690d95() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_690d95(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_690d95(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_690d95(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl new file mode 100644 index 0000000000..104391cd71 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_690d95() { + float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f, int2(0, 0)); +} + +void vertex_main() { + textureSampleLevel_690d95(); + return; +} + +void fragment_main() { + textureSampleLevel_690d95(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_690d95(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl new file mode 100644 index 0000000000..d1c3c2bb83 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_690d95() { + float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2()); +} + +vertex void vertex_main() { + textureSampleLevel_690d95(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_690d95(); + return; +} + +kernel void compute_main() { + textureSampleLevel_690d95(); + return; +} + + +tint_QmnI4P.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2()); + ^ +tint_QmnI4P.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), level(1.0f), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm new file mode 100644 index 0000000000..459833dcda --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_690d95 "textureSampleLevel_690d95" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %22 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %26 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %29 = OpConstantNull %v4float +%textureSampleLevel_690d95 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %29 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %31 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_690d95 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_690d95 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_690d95 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl new file mode 100644 index 0000000000..6296395b37 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/690d95.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_690d95() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1.0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_690d95(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_690d95(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_690d95(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl new file mode 100644 index 0000000000..ca08cfa77c --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_external; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_979816() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_979816(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_979816(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_979816(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl new file mode 100644 index 0000000000..3955bcf84f --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_979816() { + float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 0.0f); +} + +void vertex_main() { + textureSampleLevel_979816(); + return; +} + +void fragment_main() { + textureSampleLevel_979816(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_979816(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl new file mode 100644 index 0000000000..fb4f07252d --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_979816() { + float4 res = arg_0.sample(arg_1, float2(), level(0.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_979816(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_979816(); + return; +} + +kernel void compute_main() { + textureSampleLevel_979816(); + return; +} + + +tint_iGu5by.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), level(0.0f)); + ^ +tint_iGu5by.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), level(0.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm new file mode 100644 index 0000000000..13c98662fe --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.spvasm @@ -0,0 +1,71 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 37 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_979816 "textureSampleLevel_979816" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %22 = OpConstantNull %v2float + %float_0 = OpConstant %float 0 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureSampleLevel_979816 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %30 = OpFunctionCall %void %textureSampleLevel_979816 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %32 = OpLabel + %33 = OpFunctionCall %void %textureSampleLevel_979816 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %35 = OpLabel + %36 = OpFunctionCall %void %textureSampleLevel_979816 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl new file mode 100644 index 0000000000..aef0711f79 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/979816.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : external_texture; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_979816() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_979816(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_979816(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_979816(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl new file mode 100644 index 0000000000..edd4babe5f --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_9bd37b() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_9bd37b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_9bd37b(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_9bd37b(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl new file mode 100644 index 0000000000..b0833fb924 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_9bd37b() { + float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f, int3(0, 0, 0)); +} + +void vertex_main() { + textureSampleLevel_9bd37b(); + return; +} + +void fragment_main() { + textureSampleLevel_9bd37b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_9bd37b(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl new file mode 100644 index 0000000000..75bb3f356c --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_9bd37b() { + float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3()); +} + +vertex void vertex_main() { + textureSampleLevel_9bd37b(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_9bd37b(); + return; +} + +kernel void compute_main() { + textureSampleLevel_9bd37b(); + return; +} + + +tint_F0xrSV.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3()); + ^ +tint_F0xrSV.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f), int3()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm new file mode 100644 index 0000000000..fbc52c7622 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.spvasm @@ -0,0 +1,73 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_9bd37b "textureSampleLevel_9bd37b" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %26 = OpConstantNull %v3int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %29 = OpConstantNull %v4float +%textureSampleLevel_9bd37b = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %29 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod|ConstOffset %float_1 %26 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %31 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_9bd37b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_9bd37b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_9bd37b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl new file mode 100644 index 0000000000..c8d0cb1241 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/9bd37b.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_9bd37b() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0, vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_9bd37b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_9bd37b(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_9bd37b(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl new file mode 100644 index 0000000000..cbda792085 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_a4af26() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_a4af26(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_a4af26(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_a4af26(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl new file mode 100644 index 0000000000..77c9671e8b --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.hlsl @@ -0,0 +1,43 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_a4af26() { + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0)); +} + +void vertex_main() { + textureSampleLevel_a4af26(); + return; +} + +void fragment_main() { + textureSampleLevel_a4af26(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_a4af26(); + return; +} + + +tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0)); + ^ + + +tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0)); + ^ + + +tint_TRKrS9:5:48: error: too few elements in vector initialization (expected 3 elements, have 1) + float4 res = arg_0.SampleLevel(arg_1, float3(float(1)), 1.0f, int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl new file mode 100644 index 0000000000..dd8a62ed58 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_a4af26() { + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2()); +} + +vertex void vertex_main() { + textureSampleLevel_a4af26(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_a4af26(); + return; +} + +kernel void compute_main() { + textureSampleLevel_a4af26(); + return; +} + + +tint_SXV7wz.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2()); + ^ +tint_SXV7wz.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), 1, level(1.0f), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm new file mode 100644 index 0000000000..9e4d04194a --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.spvasm @@ -0,0 +1,83 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 41 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_a4af26 "textureSampleLevel_a4af26" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %float_1 = OpConstant %float 1 + %v2int = OpTypeVector %int 2 + %28 = OpConstantNull %v2int +%_ptr_Function_v4float = OpTypePointer Function %v4float + %31 = OpConstantNull %v4float +%textureSampleLevel_a4af26 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %31 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %22 = OpConvertSToF %float %int_1 + %25 = OpCompositeConstruct %v3float %22 + %15 = OpImageSampleExplicitLod %v4float %20 %25 Lod|ConstOffset %float_1 %28 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %33 = OpLabel + OpStore %tint_pointsize %float_1 + %34 = OpFunctionCall %void %textureSampleLevel_a4af26 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %36 = OpLabel + %37 = OpFunctionCall %void %textureSampleLevel_a4af26 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %39 = OpLabel + %40 = OpFunctionCall %void %textureSampleLevel_a4af26 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %25 = OpCompositeConstruct %v3float %22 + diff --git a/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl new file mode 100644 index 0000000000..db51737d5f --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/a4af26.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_a4af26() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1.0, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_a4af26(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_a4af26(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_a4af26(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl new file mode 100644 index 0000000000..ad8f4833a6 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_3d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_abfcc0() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_abfcc0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_abfcc0(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_abfcc0(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl new file mode 100644 index 0000000000..8ec0780248 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture3D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_abfcc0() { + float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); +} + +void vertex_main() { + textureSampleLevel_abfcc0(); + return; +} + +void fragment_main() { + textureSampleLevel_abfcc0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_abfcc0(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl new file mode 100644 index 0000000000..5e889aa4a5 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_abfcc0() { + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_abfcc0(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_abfcc0(); + return; +} + +kernel void compute_main() { + textureSampleLevel_abfcc0(); + return; +} + + +tint_Utz1cx.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); + ^ +tint_Utz1cx.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm new file mode 100644 index 0000000000..9ad4e35ce2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_abfcc0 "textureSampleLevel_abfcc0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleLevel_abfcc0 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleLevel_abfcc0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleLevel_abfcc0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_abfcc0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl new file mode 100644 index 0000000000..0613aea4f6 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/abfcc0.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_3d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_abfcc0() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_abfcc0(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_abfcc0(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_abfcc0(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl new file mode 100644 index 0000000000..36ed893df3 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_cube_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_ae5e39() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec3(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_ae5e39(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_ae5e39(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_ae5e39(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl new file mode 100644 index 0000000000..e9fe818621 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.hlsl @@ -0,0 +1,52 @@ +SKIP: FAILED + + + +Validation Failure: +TextureCubeArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_ae5e39() { + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); +} + +void vertex_main() { + textureSampleLevel_ae5e39(); + return; +} + +void fragment_main() { + textureSampleLevel_ae5e39(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_ae5e39(); + return; +} + + +tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ +tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ + + +tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ +tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ + + +tint_4Cjjss:5:47: error: too few elements in vector initialization (expected 4 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ +tint_4Cjjss:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float4(float(1)), 1); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl new file mode 100644 index 0000000000..f37b48b2c5 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_ae5e39() { + float res = arg_0.sample(arg_1, float3(), 1, level(1)); +} + +vertex void vertex_main() { + textureSampleLevel_ae5e39(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_ae5e39(); + return; +} + +kernel void compute_main() { + textureSampleLevel_ae5e39(); + return; +} + + +tint_mqWfoh.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float3(), 1, level(1)); + ^ +tint_mqWfoh.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float3(), 1, level(1)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm new file mode 100644 index 0000000000..1cc06da470 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.spvasm @@ -0,0 +1,82 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 39 +; Schema: 0 + OpCapability Shader + OpCapability SampledCubeArray + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_ae5e39 "textureSampleLevel_ae5e39" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_ae5e39 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %22 = OpConvertSToF %float %int_1 + %25 = OpCompositeConstruct %v4float %22 + %26 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %25 Lod %26 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %30 = OpLabel + OpStore %tint_pointsize %float_1 + %32 = OpFunctionCall %void %textureSampleLevel_ae5e39 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_ae5e39 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_ae5e39 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %25 = OpCompositeConstruct %v4float %22 + diff --git a/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl new file mode 100644 index 0000000000..aaca367080 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ae5e39.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_ae5e39() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec3(), 1, 1); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_ae5e39(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_ae5e39(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_ae5e39(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl new file mode 100644 index 0000000000..c25cf35638 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_depth_2d_array; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_ba93b3() { + var res: f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_ba93b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_ba93b3(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_ba93b3(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl new file mode 100644 index 0000000000..f6e94c586e --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.hlsl @@ -0,0 +1,48 @@ +SKIP: FAILED + + + +Validation Failure: +Texture2DArray arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_ba93b3() { + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); +} + +void vertex_main() { + textureSampleLevel_ba93b3(); + return; +} + +void fragment_main() { + textureSampleLevel_ba93b3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_ba93b3(); + return; +} + + +tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); + ^ +tint_yH0jAE:5:9: warning: implicit tru +tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); + ^ +tint_yH0jAE:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); + ^ + + +tint_yH0jAE:5:47: error: too few elements in vector initialization (expected 3 elements, have 1) + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); + ^ +tint_yH0jAE:5:9: warning: implicit truncation of vector type [-Wconversion] + float res = arg_0.SampleLevel(arg_1, float3(float(1)), 1, int2(0, 0)); + ^ + diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl new file mode 100644 index 0000000000..3c49e31c55 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_ba93b3() { + float res = arg_0.sample(arg_1, float2(), 1, level(1), int2()); +} + +vertex void vertex_main() { + textureSampleLevel_ba93b3(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_ba93b3(); + return; +} + +kernel void compute_main() { + textureSampleLevel_ba93b3(); + return; +} + + +tint_HAD0Zn.metal:5:15: error: use of undeclared identifier 'arg_0' + float res = arg_0.sample(arg_1, float2(), 1, level(1), int2()); + ^ +tint_HAD0Zn.metal:5:28: error: use of undeclared identifier 'arg_1' + float res = arg_0.sample(arg_1, float2(), 1, level(1), int2()); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm new file mode 100644 index 0000000000..d2499231d9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.spvasm @@ -0,0 +1,84 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 42 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_ba93b3 "textureSampleLevel_ba93b3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 1 1 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %20 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v2int = OpTypeVector %int 2 + %29 = OpConstantNull %v2int +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 +%textureSampleLevel_ba93b3 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %18 = OpLoad %10 %arg_1 + %19 = OpLoad %7 %arg_0 + %21 = OpSampledImage %20 %19 %18 + %23 = OpConvertSToF %float %int_1 + %26 = OpCompositeConstruct %v3float %23 + %27 = OpConvertSToF %float %int_1 + %16 = OpImageSampleExplicitLod %v4float %21 %26 Lod|ConstOffset %27 %29 + %15 = OpCompositeExtract %float %16 0 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %33 = OpLabel + OpStore %tint_pointsize %float_1 + %35 = OpFunctionCall %void %textureSampleLevel_ba93b3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %37 = OpLabel + %38 = OpFunctionCall %void %textureSampleLevel_ba93b3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %40 = OpLabel + %41 = OpFunctionCall %void %textureSampleLevel_ba93b3 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: Expected number of constituents to be at least 2 + %26 = OpCompositeConstruct %v3float %23 + diff --git a/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl new file mode 100644 index 0000000000..de65319943 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/ba93b3.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_depth_2d_array; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_ba93b3() { + var res : f32 = textureSampleLevel(arg_0, arg_1, vec2(), 1, 1, vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_ba93b3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_ba93b3(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_ba93b3(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl new file mode 100644 index 0000000000..d510ee8f83 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_cube; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_c32df7() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_c32df7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_c32df7(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_c32df7(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl new file mode 100644 index 0000000000..dddaff2fb7 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +TextureCube arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_c32df7() { + float4 res = arg_0.SampleLevel(arg_1, float3(0.0f, 0.0f, 0.0f), 1.0f); +} + +void vertex_main() { + textureSampleLevel_c32df7(); + return; +} + +void fragment_main() { + textureSampleLevel_c32df7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_c32df7(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl new file mode 100644 index 0000000000..02d477ca90 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_c32df7() { + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_c32df7(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_c32df7(); + return; +} + +kernel void compute_main() { + textureSampleLevel_c32df7(); + return; +} + + +tint_OIsoHc.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); + ^ +tint_OIsoHc.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float3(), level(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm new file mode 100644 index 0000000000..e16c043cdb --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_c32df7 "textureSampleLevel_c32df7" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v3float = OpTypeVector %float 3 + %22 = OpConstantNull %v3float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleLevel_c32df7 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleLevel_c32df7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleLevel_c32df7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_c32df7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl new file mode 100644 index 0000000000..556751a1c9 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c32df7.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_cube; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_c32df7() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec3(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_c32df7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_c32df7(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_c32df7(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl new file mode 100644 index 0000000000..39e1e8c19d --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl @@ -0,0 +1,44 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_2d; +[[group(1), binding(1)]] var arg_1: sampler; +fn textureSampleLevel_c6aca6() { + var res: vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_c6aca6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_c6aca6(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_c6aca6(); +} diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl new file mode 100644 index 0000000000..6e7600dfc2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.hlsl @@ -0,0 +1,23 @@ +Texture2D arg_0 : register(t0, space1); +SamplerState arg_1 : register(s1, space1); + +void textureSampleLevel_c6aca6() { + float4 res = arg_0.SampleLevel(arg_1, float2(0.0f, 0.0f), 1.0f); +} + +void vertex_main() { + textureSampleLevel_c6aca6(); + return; +} + +void fragment_main() { + textureSampleLevel_c6aca6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureSampleLevel_c6aca6(); + return; +} + diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl new file mode 100644 index 0000000000..4e4b5a47f2 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.msl @@ -0,0 +1,35 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureSampleLevel_c6aca6() { + float4 res = arg_0.sample(arg_1, float2(), level(1.0f)); +} + +vertex void vertex_main() { + textureSampleLevel_c6aca6(); + return; +} + +fragment void fragment_main() { + textureSampleLevel_c6aca6(); + return; +} + +kernel void compute_main() { + textureSampleLevel_c6aca6(); + return; +} + + +tint_fS8Xzw.metal:5:16: error: use of undeclared identifier 'arg_0' + float4 res = arg_0.sample(arg_1, float2(), level(1.0f)); + ^ +tint_fS8Xzw.metal:5:29: error: use of undeclared identifier 'arg_1' + float4 res = arg_0.sample(arg_1, float2(), level(1.0f)); + ^ +2 errors generated. diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm new file mode 100644 index 0000000000..94044770e0 --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %arg_1 "arg_1" + OpName %textureSampleLevel_c6aca6 "textureSampleLevel_c6aca6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %arg_1 DescriptorSet 1 + OpDecorate %arg_1 Binding 1 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %10 = OpTypeSampler +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %arg_1 = OpVariable %_ptr_UniformConstant_10 UniformConstant + %void = OpTypeVoid + %11 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %19 = OpTypeSampledImage %7 + %v2float = OpTypeVector %float 2 + %22 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %26 = OpConstantNull %v4float +%textureSampleLevel_c6aca6 = OpFunction %void None %11 + %14 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %26 + %17 = OpLoad %10 %arg_1 + %18 = OpLoad %7 %arg_0 + %20 = OpSampledImage %19 %18 %17 + %15 = OpImageSampleExplicitLod %v4float %20 %22 Lod %float_1 + OpStore %res %15 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %11 + %28 = OpLabel + OpStore %tint_pointsize %float_1 + %29 = OpFunctionCall %void %textureSampleLevel_c6aca6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %11 + %31 = OpLabel + %32 = OpFunctionCall %void %textureSampleLevel_c6aca6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %11 + %34 = OpLabel + %35 = OpFunctionCall %void %textureSampleLevel_c6aca6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl new file mode 100644 index 0000000000..3baacae31f --- /dev/null +++ b/test/intrinsics/gen/textureSampleLevel/c6aca6.wgsl.expected.wgsl @@ -0,0 +1,22 @@ +[[group(1), binding(0)]] var arg_0 : texture_2d; + +[[group(1), binding(1)]] var arg_1 : sampler; + +fn textureSampleLevel_c6aca6() { + var res : vec4 = textureSampleLevel(arg_0, arg_1, vec2(), 1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + textureSampleLevel_c6aca6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureSampleLevel_c6aca6(); +} + +[[stage(compute)]] +fn compute_main() { + textureSampleLevel_c6aca6(); +} diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl new file mode 100644 index 0000000000..f0df428e30 --- /dev/null +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_05ce15() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_05ce15(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_05ce15(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_05ce15(); +} diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl new file mode 100644 index 0000000000..d38cd87c15 --- /dev/null +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_05ce15() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_05ce15(); + return; +} + +void fragment_main() { + textureStore_05ce15(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_05ce15(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl new file mode 100644 index 0000000000..6882d8133d --- /dev/null +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_05ce15() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_05ce15(); + return; +} + +fragment void fragment_main() { + textureStore_05ce15(); + return; +} + +kernel void compute_main() { + textureStore_05ce15(); + return; +} + + +tint_9eeMzw.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm new file mode 100644 index 0000000000..d9b79d5ebf --- /dev/null +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_05ce15 "textureStore_05ce15" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_05ce15 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_05ce15 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_05ce15 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_05ce15 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl new file mode 100644 index 0000000000..75c0ae2f7e --- /dev/null +++ b/test/intrinsics/gen/textureStore/05ce15.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_05ce15() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_05ce15(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_05ce15(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_05ce15(); +} diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl new file mode 100644 index 0000000000..caa9253b55 --- /dev/null +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_064c7f() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_064c7f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_064c7f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_064c7f(); +} diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl new file mode 100644 index 0000000000..85108a6bd4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_064c7f() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_064c7f(); + return; +} + +void fragment_main() { + textureStore_064c7f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_064c7f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl new file mode 100644 index 0000000000..65538ec466 --- /dev/null +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_064c7f() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_064c7f(); + return; +} + +fragment void fragment_main() { + textureStore_064c7f(); + return; +} + +kernel void compute_main() { + textureStore_064c7f(); + return; +} + + +tint_HPJeZt.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm new file mode 100644 index 0000000000..97edb60927 --- /dev/null +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_064c7f "textureStore_064c7f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_064c7f = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_064c7f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_064c7f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_064c7f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl new file mode 100644 index 0000000000..500c2a187c --- /dev/null +++ b/test/intrinsics/gen/textureStore/064c7f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_064c7f() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_064c7f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_064c7f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_064c7f(); +} diff --git a/test/intrinsics/gen/textureStore/068641.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl new file mode 100644 index 0000000000..b5a277b795 --- /dev/null +++ b/test/intrinsics/gen/textureStore/068641.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_068641() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_068641(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_068641(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_068641(); +} diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl new file mode 100644 index 0000000000..e744a5eded --- /dev/null +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_068641() { + arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_068641(); + return; +} + +void fragment_main() { + textureStore_068641(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_068641(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl new file mode 100644 index 0000000000..4b9e7b99e6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_068641() { + arg_0.write(uint4(), int3()); +} + +vertex void vertex_main() { + textureStore_068641(); + return; +} + +fragment void fragment_main() { + textureStore_068641(); + return; +} + +kernel void compute_main() { + textureStore_068641(); + return; +} + + +tint_yRIG80.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm new file mode 100644 index 0000000000..17de55622e --- /dev/null +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_068641 "textureStore_068641" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_068641 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_068641 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_068641 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_068641 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl new file mode 100644 index 0000000000..1cff6cd7b0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/068641.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_068641() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_068641(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_068641(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_068641(); +} diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl new file mode 100644 index 0000000000..dbcb216325 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_0af6b5() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_0af6b5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_0af6b5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_0af6b5(); +} diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl new file mode 100644 index 0000000000..6e80c554df --- /dev/null +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_0af6b5() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_0af6b5(); + return; +} + +void fragment_main() { + textureStore_0af6b5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_0af6b5(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl new file mode 100644 index 0000000000..cb8727bd4e --- /dev/null +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_0af6b5() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_0af6b5(); + return; +} + +fragment void fragment_main() { + textureStore_0af6b5(); + return; +} + +kernel void compute_main() { + textureStore_0af6b5(); + return; +} + + +tint_XLLIfe.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm new file mode 100644 index 0000000000..d651f50989 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_0af6b5 "textureStore_0af6b5" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_0af6b5 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_0af6b5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_0af6b5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_0af6b5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl new file mode 100644 index 0000000000..dedf0b6e71 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0af6b5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_0af6b5() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_0af6b5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_0af6b5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_0af6b5(); +} diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl new file mode 100644 index 0000000000..b6189de99d --- /dev/null +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_0c3dff() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_0c3dff(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_0c3dff(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_0c3dff(); +} diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl new file mode 100644 index 0000000000..dcc9b15586 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_0c3dff() { + arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_0c3dff(); + return; +} + +void fragment_main() { + textureStore_0c3dff(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_0c3dff(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl new file mode 100644 index 0000000000..9290996b94 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_0c3dff() { + arg_0.write(uint4(), int2()); +} + +vertex void vertex_main() { + textureStore_0c3dff(); + return; +} + +fragment void fragment_main() { + textureStore_0c3dff(); + return; +} + +kernel void compute_main() { + textureStore_0c3dff(); + return; +} + + +tint_U5Oofe.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm new file mode 100644 index 0000000000..32263fd741 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_0c3dff "textureStore_0c3dff" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_0c3dff = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_0c3dff + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_0c3dff + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_0c3dff + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl new file mode 100644 index 0000000000..6420eaf7e7 --- /dev/null +++ b/test/intrinsics/gen/textureStore/0c3dff.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_0c3dff() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_0c3dff(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_0c3dff(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_0c3dff(); +} diff --git a/test/intrinsics/gen/textureStore/102722.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl new file mode 100644 index 0000000000..c1c0bf41bb --- /dev/null +++ b/test/intrinsics/gen/textureStore/102722.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_102722() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_102722(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_102722(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_102722(); +} diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl new file mode 100644 index 0000000000..bfbb63b9c1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_102722() { + arg_0[1] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_102722(); + return; +} + +void fragment_main() { + textureStore_102722(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_102722(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl new file mode 100644 index 0000000000..dc52f88b62 --- /dev/null +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_102722() { + arg_0.write(uint4(), 1); +} + +vertex void vertex_main() { + textureStore_102722(); + return; +} + +fragment void fragment_main() { + textureStore_102722(); + return; +} + +kernel void compute_main() { + textureStore_102722(); + return; +} + + +tint_FWnulI.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm new file mode 100644 index 0000000000..0406d1563a --- /dev/null +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_102722 "textureStore_102722" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4uint = OpTypeVector %uint 4 + %18 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_102722 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_102722 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_102722 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_102722 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl new file mode 100644 index 0000000000..bab8dc470a --- /dev/null +++ b/test/intrinsics/gen/textureStore/102722.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_102722() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_102722(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_102722(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_102722(); +} diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl new file mode 100644 index 0000000000..5296393fef --- /dev/null +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_1bbd08() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_1bbd08(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_1bbd08(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_1bbd08(); +} diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl new file mode 100644 index 0000000000..561bce98b8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_1bbd08() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_1bbd08(); + return; +} + +void fragment_main() { + textureStore_1bbd08(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_1bbd08(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl new file mode 100644 index 0000000000..e5f3aa7b90 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_1bbd08() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_1bbd08(); + return; +} + +fragment void fragment_main() { + textureStore_1bbd08(); + return; +} + +kernel void compute_main() { + textureStore_1bbd08(); + return; +} + + +tint_dwpRke.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm new file mode 100644 index 0000000000..9bde491971 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_1bbd08 "textureStore_1bbd08" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_1bbd08 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_1bbd08 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_1bbd08 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_1bbd08 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl new file mode 100644 index 0000000000..0b676c29a8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1bbd08.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_1bbd08() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_1bbd08(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_1bbd08(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_1bbd08(); +} diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl new file mode 100644 index 0000000000..0170e0094e --- /dev/null +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_1c02e7() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_1c02e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_1c02e7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_1c02e7(); +} diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl new file mode 100644 index 0000000000..dbbaade2a7 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_1c02e7() { + arg_0[int3(1)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_1c02e7(); + return; +} + +void fragment_main() { + textureStore_1c02e7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_1c02e7(); + return; +} + + +tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_9SEdo4:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl new file mode 100644 index 0000000000..61d0b7a5f8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_1c02e7() { + arg_0.write(int4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_1c02e7(); + return; +} + +fragment void fragment_main() { + textureStore_1c02e7(); + return; +} + +kernel void compute_main() { + textureStore_1c02e7(); + return; +} + + +tint_CpbCeH.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm new file mode 100644 index 0000000000..c8425214d8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_1c02e7 "textureStore_1c02e7" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4int = OpTypeVector %int 4 + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_1c02e7 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_1c02e7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_1c02e7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_1c02e7 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl new file mode 100644 index 0000000000..715524fae5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/1c02e7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_1c02e7() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_1c02e7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_1c02e7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_1c02e7(); +} diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl new file mode 100644 index 0000000000..815e628eed --- /dev/null +++ b/test/intrinsics/gen/textureStore/22d955.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_22d955() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_22d955(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_22d955(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_22d955(); +} diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl new file mode 100644 index 0000000000..cf011fce5e --- /dev/null +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_22d955() { + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_22d955(); + return; +} + +void fragment_main() { + textureStore_22d955(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_22d955(); + return; +} + + +tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_Qx2ZJJ:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl new file mode 100644 index 0000000000..cd4b05ebde --- /dev/null +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_22d955() { + arg_0.write(uint4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_22d955(); + return; +} + +fragment void fragment_main() { + textureStore_22d955(); + return; +} + +kernel void compute_main() { + textureStore_22d955(); + return; +} + + +tint_4GbpDy.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm new file mode 100644 index 0000000000..710de9ade8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_22d955 "textureStore_22d955" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 + %v4uint = OpTypeVector %uint 4 + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_22d955 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %18 %20 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureStore_22d955 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_22d955 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureStore_22d955 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl new file mode 100644 index 0000000000..08c8bb1a13 --- /dev/null +++ b/test/intrinsics/gen/textureStore/22d955.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_22d955() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_22d955(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_22d955(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_22d955(); +} diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl new file mode 100644 index 0000000000..693d8e8432 --- /dev/null +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_26bf70() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_26bf70(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_26bf70(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_26bf70(); +} diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl new file mode 100644 index 0000000000..8a9bbda461 --- /dev/null +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_26bf70() { + arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_26bf70(); + return; +} + +void fragment_main() { + textureStore_26bf70(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_26bf70(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl new file mode 100644 index 0000000000..30ff0a8f6f --- /dev/null +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_26bf70() { + arg_0.write(uint4(), int2()); +} + +vertex void vertex_main() { + textureStore_26bf70(); + return; +} + +fragment void fragment_main() { + textureStore_26bf70(); + return; +} + +kernel void compute_main() { + textureStore_26bf70(); + return; +} + + +tint_u7QeEL.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a8ef15692 --- /dev/null +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_26bf70 "textureStore_26bf70" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_26bf70 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_26bf70 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_26bf70 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_26bf70 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl new file mode 100644 index 0000000000..d1ff649d71 --- /dev/null +++ b/test/intrinsics/gen/textureStore/26bf70.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_26bf70() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_26bf70(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_26bf70(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_26bf70(); +} diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl new file mode 100644 index 0000000000..3b2e3b2791 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_2796b4() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2796b4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2796b4(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2796b4(); +} diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl new file mode 100644 index 0000000000..88e1e0f292 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_2796b4() { + arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_2796b4(); + return; +} + +void fragment_main() { + textureStore_2796b4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_2796b4(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl new file mode 100644 index 0000000000..aff37f8532 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_2796b4() { + arg_0.write(int4(), int3()); +} + +vertex void vertex_main() { + textureStore_2796b4(); + return; +} + +fragment void fragment_main() { + textureStore_2796b4(); + return; +} + +kernel void compute_main() { + textureStore_2796b4(); + return; +} + + +tint_hHByVz.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm new file mode 100644 index 0000000000..e26f6b6dad --- /dev/null +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_2796b4 "textureStore_2796b4" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_2796b4 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_2796b4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_2796b4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_2796b4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl new file mode 100644 index 0000000000..d307706df5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2796b4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_2796b4() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2796b4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2796b4(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2796b4(); +} diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl new file mode 100644 index 0000000000..7a5200fb65 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_2ac6c7() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2ac6c7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2ac6c7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2ac6c7(); +} diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl new file mode 100644 index 0000000000..2e5bd837cc --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_2ac6c7() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_2ac6c7(); + return; +} + +void fragment_main() { + textureStore_2ac6c7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_2ac6c7(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl new file mode 100644 index 0000000000..c73714bb7d --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_2ac6c7() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_2ac6c7(); + return; +} + +fragment void fragment_main() { + textureStore_2ac6c7(); + return; +} + +kernel void compute_main() { + textureStore_2ac6c7(); + return; +} + + +tint_FUFaCJ.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm new file mode 100644 index 0000000000..6a05c5c7ad --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_2ac6c7 "textureStore_2ac6c7" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_2ac6c7 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_2ac6c7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_2ac6c7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_2ac6c7 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl new file mode 100644 index 0000000000..7d3f57a4ef --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ac6c7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_2ac6c7() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2ac6c7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2ac6c7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2ac6c7(); +} diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl new file mode 100644 index 0000000000..2f4f9d7d94 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_2eb2a4() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2eb2a4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2eb2a4(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2eb2a4(); +} diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl new file mode 100644 index 0000000000..2bfcdebb87 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_2eb2a4() { + arg_0[1] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_2eb2a4(); + return; +} + +void fragment_main() { + textureStore_2eb2a4(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_2eb2a4(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl new file mode 100644 index 0000000000..87d35c0efe --- /dev/null +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_2eb2a4() { + arg_0.write(uint4(), 1); +} + +vertex void vertex_main() { + textureStore_2eb2a4(); + return; +} + +fragment void fragment_main() { + textureStore_2eb2a4(); + return; +} + +kernel void compute_main() { + textureStore_2eb2a4(); + return; +} + + +tint_PNmP6G.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm new file mode 100644 index 0000000000..fd59253d09 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_2eb2a4 "textureStore_2eb2a4" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4uint = OpTypeVector %uint 4 + %18 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_2eb2a4 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_2eb2a4 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_2eb2a4 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_2eb2a4 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl new file mode 100644 index 0000000000..f62d13756e --- /dev/null +++ b/test/intrinsics/gen/textureStore/2eb2a4.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_2eb2a4() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2eb2a4(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2eb2a4(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2eb2a4(); +} diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl new file mode 100644 index 0000000000..c710a474c9 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_2ed2a3() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2ed2a3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2ed2a3(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2ed2a3(); +} diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl new file mode 100644 index 0000000000..61caf3b2d8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_2ed2a3() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_2ed2a3(); + return; +} + +void fragment_main() { + textureStore_2ed2a3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_2ed2a3(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl new file mode 100644 index 0000000000..c592342596 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_2ed2a3() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_2ed2a3(); + return; +} + +fragment void fragment_main() { + textureStore_2ed2a3(); + return; +} + +kernel void compute_main() { + textureStore_2ed2a3(); + return; +} + + +tint_k1UauU.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm new file mode 100644 index 0000000000..3c4624c899 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_2ed2a3 "textureStore_2ed2a3" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_2ed2a3 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_2ed2a3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_2ed2a3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_2ed2a3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl new file mode 100644 index 0000000000..366b088640 --- /dev/null +++ b/test/intrinsics/gen/textureStore/2ed2a3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_2ed2a3() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_2ed2a3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_2ed2a3(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_2ed2a3(); +} diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl new file mode 100644 index 0000000000..be9ae4069e --- /dev/null +++ b/test/intrinsics/gen/textureStore/31745b.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_31745b() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_31745b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_31745b(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_31745b(); +} diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl new file mode 100644 index 0000000000..2205238aa3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_31745b() { + arg_0[int2(0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_31745b(); + return; +} + +void fragment_main() { + textureStore_31745b(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_31745b(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl new file mode 100644 index 0000000000..b29dadbf60 --- /dev/null +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_31745b() { + arg_0.write(int4(), int2()); +} + +vertex void vertex_main() { + textureStore_31745b(); + return; +} + +fragment void fragment_main() { + textureStore_31745b(); + return; +} + +kernel void compute_main() { + textureStore_31745b(); + return; +} + + +tint_4hXtaI.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm new file mode 100644 index 0000000000..101f8dd792 --- /dev/null +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_31745b "textureStore_31745b" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_31745b = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_31745b + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_31745b + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_31745b + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl new file mode 100644 index 0000000000..fc1848fcf2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/31745b.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_31745b() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_31745b(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_31745b(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_31745b(); +} diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl new file mode 100644 index 0000000000..82fea1780f --- /dev/null +++ b/test/intrinsics/gen/textureStore/32f368.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_32f368() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_32f368(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_32f368(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_32f368(); +} diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl new file mode 100644 index 0000000000..f15b94b65e --- /dev/null +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_32f368() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_32f368(); + return; +} + +void fragment_main() { + textureStore_32f368(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_32f368(); + return; +} + + +tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_CQZOh9:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl new file mode 100644 index 0000000000..d915febcd5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_32f368() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_32f368(); + return; +} + +fragment void fragment_main() { + textureStore_32f368(); + return; +} + +kernel void compute_main() { + textureStore_32f368(); + return; +} + + +tint_bxPhKa.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm new file mode 100644 index 0000000000..d8b5b0d0e6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_32f368 "textureStore_32f368" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_32f368 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_32f368 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_32f368 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_32f368 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl new file mode 100644 index 0000000000..43d6af5634 --- /dev/null +++ b/test/intrinsics/gen/textureStore/32f368.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_32f368() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_32f368(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_32f368(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_32f368(); +} diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl new file mode 100644 index 0000000000..f4bf4e4681 --- /dev/null +++ b/test/intrinsics/gen/textureStore/331aee.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_331aee() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_331aee(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_331aee(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_331aee(); +} diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl new file mode 100644 index 0000000000..ef51064172 --- /dev/null +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_331aee() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_331aee(); + return; +} + +void fragment_main() { + textureStore_331aee(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_331aee(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl new file mode 100644 index 0000000000..975862cc57 --- /dev/null +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_331aee() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_331aee(); + return; +} + +fragment void fragment_main() { + textureStore_331aee(); + return; +} + +kernel void compute_main() { + textureStore_331aee(); + return; +} + + +tint_kixkHt.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm new file mode 100644 index 0000000000..1c6d255e14 --- /dev/null +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_331aee "textureStore_331aee" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_331aee = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_331aee + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_331aee + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_331aee + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl new file mode 100644 index 0000000000..d1ed0c6401 --- /dev/null +++ b/test/intrinsics/gen/textureStore/331aee.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_331aee() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_331aee(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_331aee(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_331aee(); +} diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl new file mode 100644 index 0000000000..e6bb10305f --- /dev/null +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_38e8d7() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_38e8d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_38e8d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_38e8d7(); +} diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl new file mode 100644 index 0000000000..269ec63ef0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_38e8d7() { + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_38e8d7(); + return; +} + +void fragment_main() { + textureStore_38e8d7(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_38e8d7(); + return; +} + + +tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_I6q35O:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl new file mode 100644 index 0000000000..a29fc2971a --- /dev/null +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_38e8d7() { + arg_0.write(uint4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_38e8d7(); + return; +} + +fragment void fragment_main() { + textureStore_38e8d7(); + return; +} + +kernel void compute_main() { + textureStore_38e8d7(); + return; +} + + +tint_x2IjFo.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm new file mode 100644 index 0000000000..d5e69af323 --- /dev/null +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_38e8d7 "textureStore_38e8d7" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 + %v4uint = OpTypeVector %uint 4 + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_38e8d7 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %18 %20 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureStore_38e8d7 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_38e8d7 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureStore_38e8d7 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl new file mode 100644 index 0000000000..50a53ca677 --- /dev/null +++ b/test/intrinsics/gen/textureStore/38e8d7.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_38e8d7() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_38e8d7(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_38e8d7(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_38e8d7(); +} diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl new file mode 100644 index 0000000000..c815964f55 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_3a52ac() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3a52ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3a52ac(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3a52ac(); +} diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl new file mode 100644 index 0000000000..e40d375a8a --- /dev/null +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_3a52ac() { + arg_0[int3(1)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_3a52ac(); + return; +} + +void fragment_main() { + textureStore_3a52ac(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_3a52ac(); + return; +} + + +tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_HKMJgS:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl new file mode 100644 index 0000000000..1468a7e06b --- /dev/null +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_3a52ac() { + arg_0.write(int4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_3a52ac(); + return; +} + +fragment void fragment_main() { + textureStore_3a52ac(); + return; +} + +kernel void compute_main() { + textureStore_3a52ac(); + return; +} + + +tint_N2pxwW.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm new file mode 100644 index 0000000000..91f568d81a --- /dev/null +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_3a52ac "textureStore_3a52ac" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4int = OpTypeVector %int 4 + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_3a52ac = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_3a52ac + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_3a52ac + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_3a52ac + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl new file mode 100644 index 0000000000..85d39aabd7 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3a52ac.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_3a52ac() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3a52ac(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3a52ac(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3a52ac(); +} diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl new file mode 100644 index 0000000000..3ee4fd6bac --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_3bb7a1() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3bb7a1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3bb7a1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3bb7a1(); +} diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl new file mode 100644 index 0000000000..a901a84603 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_3bb7a1() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_3bb7a1(); + return; +} + +void fragment_main() { + textureStore_3bb7a1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_3bb7a1(); + return; +} + + +tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_vqF2F7:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl new file mode 100644 index 0000000000..d4b0d0d0a8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_3bb7a1() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_3bb7a1(); + return; +} + +fragment void fragment_main() { + textureStore_3bb7a1(); + return; +} + +kernel void compute_main() { + textureStore_3bb7a1(); + return; +} + + +tint_L0adSp.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a776065ef --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_3bb7a1 "textureStore_3bb7a1" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_3bb7a1 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_3bb7a1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_3bb7a1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_3bb7a1 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl new file mode 100644 index 0000000000..87ece03d14 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bb7a1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_3bb7a1() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3bb7a1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3bb7a1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3bb7a1(); +} diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl new file mode 100644 index 0000000000..aad435ef86 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_3bec15() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3bec15(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3bec15(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3bec15(); +} diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl new file mode 100644 index 0000000000..cfcedd93cc --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_3bec15() { + arg_0[1] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_3bec15(); + return; +} + +void fragment_main() { + textureStore_3bec15(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_3bec15(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl new file mode 100644 index 0000000000..9a4bb4555a --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_3bec15() { + arg_0.write(uint4(), 1); +} + +vertex void vertex_main() { + textureStore_3bec15(); + return; +} + +fragment void fragment_main() { + textureStore_3bec15(); + return; +} + +kernel void compute_main() { + textureStore_3bec15(); + return; +} + + +tint_7THBtQ.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm new file mode 100644 index 0000000000..5a80a9d3b5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_3bec15 "textureStore_3bec15" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4uint = OpTypeVector %uint 4 + %18 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_3bec15 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_3bec15 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_3bec15 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_3bec15 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl new file mode 100644 index 0000000000..2cadcbe19d --- /dev/null +++ b/test/intrinsics/gen/textureStore/3bec15.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_3bec15() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_3bec15(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_3bec15(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_3bec15(); +} diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl new file mode 100644 index 0000000000..5846c1c9e4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_441ba8() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_441ba8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_441ba8(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_441ba8(); +} diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl new file mode 100644 index 0000000000..c980a0e8fb --- /dev/null +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_441ba8() { + arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_441ba8(); + return; +} + +void fragment_main() { + textureStore_441ba8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_441ba8(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl new file mode 100644 index 0000000000..6c5454beaa --- /dev/null +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_441ba8() { + arg_0.write(uint4(), int3()); +} + +vertex void vertex_main() { + textureStore_441ba8(); + return; +} + +fragment void fragment_main() { + textureStore_441ba8(); + return; +} + +kernel void compute_main() { + textureStore_441ba8(); + return; +} + + +tint_FcfuwY.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm new file mode 100644 index 0000000000..40cc744571 --- /dev/null +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_441ba8 "textureStore_441ba8" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_441ba8 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_441ba8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_441ba8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_441ba8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl new file mode 100644 index 0000000000..ac7be08caa --- /dev/null +++ b/test/intrinsics/gen/textureStore/441ba8.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_441ba8() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_441ba8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_441ba8(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_441ba8(); +} diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl new file mode 100644 index 0000000000..cc4151174b --- /dev/null +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_4fc057() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_4fc057(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_4fc057(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_4fc057(); +} diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl new file mode 100644 index 0000000000..1316e267b4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_4fc057() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_4fc057(); + return; +} + +void fragment_main() { + textureStore_4fc057(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_4fc057(); + return; +} + + +tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_1VwWVV:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl new file mode 100644 index 0000000000..e0e9cc6b27 --- /dev/null +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_4fc057() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_4fc057(); + return; +} + +fragment void fragment_main() { + textureStore_4fc057(); + return; +} + +kernel void compute_main() { + textureStore_4fc057(); + return; +} + + +tint_xwVRdI.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm new file mode 100644 index 0000000000..9d0621b83e --- /dev/null +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_4fc057 "textureStore_4fc057" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_4fc057 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_4fc057 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_4fc057 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_4fc057 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl new file mode 100644 index 0000000000..1a909f8baa --- /dev/null +++ b/test/intrinsics/gen/textureStore/4fc057.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_4fc057() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_4fc057(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_4fc057(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_4fc057(); +} diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl new file mode 100644 index 0000000000..063eecc761 --- /dev/null +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_5a2f8f() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_5a2f8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_5a2f8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_5a2f8f(); +} diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl new file mode 100644 index 0000000000..88412b51ac --- /dev/null +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_5a2f8f() { + arg_0[1] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_5a2f8f(); + return; +} + +void fragment_main() { + textureStore_5a2f8f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_5a2f8f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl new file mode 100644 index 0000000000..123767fe98 --- /dev/null +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_5a2f8f() { + arg_0.write(int4(), 1); +} + +vertex void vertex_main() { + textureStore_5a2f8f(); + return; +} + +fragment void fragment_main() { + textureStore_5a2f8f(); + return; +} + +kernel void compute_main() { + textureStore_5a2f8f(); + return; +} + + +tint_iDp0i1.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm new file mode 100644 index 0000000000..269e38cea1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_5a2f8f "textureStore_5a2f8f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int_1 = OpConstant %int 1 + %v4int = OpTypeVector %int 4 + %17 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_5a2f8f = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_5a2f8f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_5a2f8f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_5a2f8f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl new file mode 100644 index 0000000000..3053085e66 --- /dev/null +++ b/test/intrinsics/gen/textureStore/5a2f8f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_5a2f8f() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_5a2f8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_5a2f8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_5a2f8f(); +} diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl new file mode 100644 index 0000000000..55007375f2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/60975f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_60975f() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_60975f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_60975f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_60975f(); +} diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl new file mode 100644 index 0000000000..a3b60bb657 --- /dev/null +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_60975f() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_60975f(); + return; +} + +void fragment_main() { + textureStore_60975f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_60975f(); + return; +} + + +tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_vi6mOd:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl new file mode 100644 index 0000000000..0b6f3e689b --- /dev/null +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_60975f() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_60975f(); + return; +} + +fragment void fragment_main() { + textureStore_60975f(); + return; +} + +kernel void compute_main() { + textureStore_60975f(); + return; +} + + +tint_K8XxnZ.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm new file mode 100644 index 0000000000..3a5c361ab2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_60975f "textureStore_60975f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_60975f = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_60975f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_60975f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_60975f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl new file mode 100644 index 0000000000..c7689fcbc5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/60975f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_60975f() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_60975f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_60975f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_60975f(); +} diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl new file mode 100644 index 0000000000..ec1f1ae149 --- /dev/null +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_682fd6() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_682fd6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_682fd6(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_682fd6(); +} diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl new file mode 100644 index 0000000000..3a8b9d07c4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_682fd6() { + arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_682fd6(); + return; +} + +void fragment_main() { + textureStore_682fd6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_682fd6(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl new file mode 100644 index 0000000000..85a3f53eef --- /dev/null +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_682fd6() { + arg_0.write(uint4(), int2()); +} + +vertex void vertex_main() { + textureStore_682fd6(); + return; +} + +fragment void fragment_main() { + textureStore_682fd6(); + return; +} + +kernel void compute_main() { + textureStore_682fd6(); + return; +} + + +tint_7adx7Y.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm new file mode 100644 index 0000000000..646031d27a --- /dev/null +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_682fd6 "textureStore_682fd6" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_682fd6 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_682fd6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_682fd6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_682fd6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl new file mode 100644 index 0000000000..0bfa046cc0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/682fd6.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_682fd6() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_682fd6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_682fd6(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_682fd6(); +} diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl new file mode 100644 index 0000000000..187bba1f8f --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_6b75c3() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6b75c3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6b75c3(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6b75c3(); +} diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl new file mode 100644 index 0000000000..677e584e04 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_6b75c3() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_6b75c3(); + return; +} + +void fragment_main() { + textureStore_6b75c3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_6b75c3(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl new file mode 100644 index 0000000000..a1e85878bd --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_6b75c3() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_6b75c3(); + return; +} + +fragment void fragment_main() { + textureStore_6b75c3(); + return; +} + +kernel void compute_main() { + textureStore_6b75c3(); + return; +} + + +tint_0jiMIP.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm new file mode 100644 index 0000000000..51ee16a9f2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_6b75c3 "textureStore_6b75c3" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_6b75c3 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_6b75c3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_6b75c3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_6b75c3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl new file mode 100644 index 0000000000..54e64b0f6e --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b75c3.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_6b75c3() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6b75c3(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6b75c3(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6b75c3(); +} diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl new file mode 100644 index 0000000000..cfded420fb --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_6b80d2() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6b80d2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6b80d2(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6b80d2(); +} diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl new file mode 100644 index 0000000000..eac402ee29 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_6b80d2() { + arg_0[1] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_6b80d2(); + return; +} + +void fragment_main() { + textureStore_6b80d2(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_6b80d2(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl new file mode 100644 index 0000000000..5db01bc4f7 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_6b80d2() { + arg_0.write(int4(), 1); +} + +vertex void vertex_main() { + textureStore_6b80d2(); + return; +} + +fragment void fragment_main() { + textureStore_6b80d2(); + return; +} + +kernel void compute_main() { + textureStore_6b80d2(); + return; +} + + +tint_GXJj7s.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm new file mode 100644 index 0000000000..2ec370c267 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_6b80d2 "textureStore_6b80d2" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int_1 = OpConstant %int 1 + %v4int = OpTypeVector %int 4 + %17 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_6b80d2 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_6b80d2 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_6b80d2 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_6b80d2 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl new file mode 100644 index 0000000000..6ab7b61510 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6b80d2.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_6b80d2() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6b80d2(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6b80d2(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6b80d2(); +} diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl new file mode 100644 index 0000000000..987f5fef8f --- /dev/null +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_6cff2e() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6cff2e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6cff2e(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6cff2e(); +} diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl new file mode 100644 index 0000000000..e149a2adbb --- /dev/null +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_6cff2e() { + arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_6cff2e(); + return; +} + +void fragment_main() { + textureStore_6cff2e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_6cff2e(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl new file mode 100644 index 0000000000..e1bd31aaaf --- /dev/null +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_6cff2e() { + arg_0.write(uint4(), int2()); +} + +vertex void vertex_main() { + textureStore_6cff2e(); + return; +} + +fragment void fragment_main() { + textureStore_6cff2e(); + return; +} + +kernel void compute_main() { + textureStore_6cff2e(); + return; +} + + +tint_UZX5yc.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm new file mode 100644 index 0000000000..83a83e7900 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_6cff2e "textureStore_6cff2e" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_6cff2e = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_6cff2e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_6cff2e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_6cff2e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl new file mode 100644 index 0000000000..85ea47f91d --- /dev/null +++ b/test/intrinsics/gen/textureStore/6cff2e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_6cff2e() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6cff2e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6cff2e(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6cff2e(); +} diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl new file mode 100644 index 0000000000..e811e0122e --- /dev/null +++ b/test/intrinsics/gen/textureStore/6da692.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_6da692() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6da692(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6da692(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6da692(); +} diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl new file mode 100644 index 0000000000..ddf5d6f977 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_6da692() { + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_6da692(); + return; +} + +void fragment_main() { + textureStore_6da692(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_6da692(); + return; +} + + +tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_aYSvaH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl new file mode 100644 index 0000000000..69ef6cc494 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_6da692() { + arg_0.write(uint4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_6da692(); + return; +} + +fragment void fragment_main() { + textureStore_6da692(); + return; +} + +kernel void compute_main() { + textureStore_6da692(); + return; +} + + +tint_efhqMi.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm new file mode 100644 index 0000000000..2c7fc02af0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_6da692 "textureStore_6da692" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 + %v4uint = OpTypeVector %uint 4 + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_6da692 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %18 %20 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureStore_6da692 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_6da692 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureStore_6da692 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl new file mode 100644 index 0000000000..da170658a0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/6da692.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_6da692() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_6da692(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_6da692(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_6da692(); +} diff --git a/test/intrinsics/gen/textureStore/731349.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl new file mode 100644 index 0000000000..ad47ce9902 --- /dev/null +++ b/test/intrinsics/gen/textureStore/731349.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_731349() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_731349(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_731349(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_731349(); +} diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl new file mode 100644 index 0000000000..c6530ca8df --- /dev/null +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_731349() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_731349(); + return; +} + +void fragment_main() { + textureStore_731349(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_731349(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl new file mode 100644 index 0000000000..7fb91681de --- /dev/null +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_731349() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_731349(); + return; +} + +fragment void fragment_main() { + textureStore_731349(); + return; +} + +kernel void compute_main() { + textureStore_731349(); + return; +} + + +tint_3Zm8LE.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm new file mode 100644 index 0000000000..577af62004 --- /dev/null +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_731349 "textureStore_731349" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_731349 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_731349 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_731349 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_731349 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl new file mode 100644 index 0000000000..5b527d84e7 --- /dev/null +++ b/test/intrinsics/gen/textureStore/731349.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_731349() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_731349(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_731349(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_731349(); +} diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl new file mode 100644 index 0000000000..4424bb3ac3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/752da6.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_752da6() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_752da6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_752da6(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_752da6(); +} diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl new file mode 100644 index 0000000000..60c15a116f --- /dev/null +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_752da6() { + arg_0[int2(0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_752da6(); + return; +} + +void fragment_main() { + textureStore_752da6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_752da6(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl new file mode 100644 index 0000000000..4199b3f359 --- /dev/null +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_752da6() { + arg_0.write(int4(), int2()); +} + +vertex void vertex_main() { + textureStore_752da6(); + return; +} + +fragment void fragment_main() { + textureStore_752da6(); + return; +} + +kernel void compute_main() { + textureStore_752da6(); + return; +} + + +tint_zgq0Dl.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm new file mode 100644 index 0000000000..4219376127 --- /dev/null +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_752da6 "textureStore_752da6" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_752da6 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_752da6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_752da6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_752da6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl new file mode 100644 index 0000000000..2348d36c55 --- /dev/null +++ b/test/intrinsics/gen/textureStore/752da6.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_752da6() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_752da6(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_752da6(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_752da6(); +} diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl new file mode 100644 index 0000000000..bce5f33880 --- /dev/null +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_77c0ae() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_77c0ae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_77c0ae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_77c0ae(); +} diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl new file mode 100644 index 0000000000..9705f28aff --- /dev/null +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_77c0ae() { + arg_0[int2(0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_77c0ae(); + return; +} + +void fragment_main() { + textureStore_77c0ae(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_77c0ae(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl new file mode 100644 index 0000000000..dcc371e2f6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_77c0ae() { + arg_0.write(uint4(), int2()); +} + +vertex void vertex_main() { + textureStore_77c0ae(); + return; +} + +fragment void fragment_main() { + textureStore_77c0ae(); + return; +} + +kernel void compute_main() { + textureStore_77c0ae(); + return; +} + + +tint_zmPi8W.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm new file mode 100644 index 0000000000..7434c65fdf --- /dev/null +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_77c0ae "textureStore_77c0ae" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %17 = OpConstantNull %v2int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_77c0ae = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_77c0ae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_77c0ae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_77c0ae + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl new file mode 100644 index 0000000000..8ff941ae46 --- /dev/null +++ b/test/intrinsics/gen/textureStore/77c0ae.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_77c0ae() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_77c0ae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_77c0ae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_77c0ae(); +} diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl new file mode 100644 index 0000000000..7bf0a3baaa --- /dev/null +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_7cec8d() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_7cec8d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_7cec8d(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_7cec8d(); +} diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl new file mode 100644 index 0000000000..5fb0ec2ba3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_7cec8d() { + arg_0[int3(1)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_7cec8d(); + return; +} + +void fragment_main() { + textureStore_7cec8d(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_7cec8d(); + return; +} + + +tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_9ZEmy6:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl new file mode 100644 index 0000000000..1acbb0495f --- /dev/null +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_7cec8d() { + arg_0.write(int4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_7cec8d(); + return; +} + +fragment void fragment_main() { + textureStore_7cec8d(); + return; +} + +kernel void compute_main() { + textureStore_7cec8d(); + return; +} + + +tint_YM1K5G.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm new file mode 100644 index 0000000000..9abd3e486a --- /dev/null +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_7cec8d "textureStore_7cec8d" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4int = OpTypeVector %int 4 + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_7cec8d = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_7cec8d + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_7cec8d + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_7cec8d + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl new file mode 100644 index 0000000000..3ba2f7faad --- /dev/null +++ b/test/intrinsics/gen/textureStore/7cec8d.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_7cec8d() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_7cec8d(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_7cec8d(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_7cec8d(); +} diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl new file mode 100644 index 0000000000..203a4a5ef0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_7f7fae() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_7f7fae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_7f7fae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_7f7fae(); +} diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl new file mode 100644 index 0000000000..02423590c1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_7f7fae() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_7f7fae(); + return; +} + +void fragment_main() { + textureStore_7f7fae(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_7f7fae(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl new file mode 100644 index 0000000000..9fb1788190 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_7f7fae() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_7f7fae(); + return; +} + +fragment void fragment_main() { + textureStore_7f7fae(); + return; +} + +kernel void compute_main() { + textureStore_7f7fae(); + return; +} + + +tint_l2ha2e.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm new file mode 100644 index 0000000000..6adb368d51 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_7f7fae "textureStore_7f7fae" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba8 +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_7f7fae = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_7f7fae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_7f7fae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_7f7fae + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl new file mode 100644 index 0000000000..e8ec3ee480 --- /dev/null +++ b/test/intrinsics/gen/textureStore/7f7fae.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_7f7fae() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_7f7fae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_7f7fae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_7f7fae(); +} diff --git a/test/intrinsics/gen/textureStore/804942.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl new file mode 100644 index 0000000000..a27738f4c2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/804942.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_804942() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_804942(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_804942(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_804942(); +} diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl new file mode 100644 index 0000000000..226ade13e2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_804942() { + arg_0[int2(0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_804942(); + return; +} + +void fragment_main() { + textureStore_804942(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_804942(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl new file mode 100644 index 0000000000..691a370d24 --- /dev/null +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_804942() { + arg_0.write(int4(), int2()); +} + +vertex void vertex_main() { + textureStore_804942(); + return; +} + +fragment void fragment_main() { + textureStore_804942(); + return; +} + +kernel void compute_main() { + textureStore_804942(); + return; +} + + +tint_bnGq7U.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm new file mode 100644 index 0000000000..2a1b747e05 --- /dev/null +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_804942 "textureStore_804942" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_804942 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_804942 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_804942 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_804942 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl new file mode 100644 index 0000000000..ed39788e20 --- /dev/null +++ b/test/intrinsics/gen/textureStore/804942.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_804942() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_804942(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_804942(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_804942(); +} diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl new file mode 100644 index 0000000000..427a6a239a --- /dev/null +++ b/test/intrinsics/gen/textureStore/805dae.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_805dae() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_805dae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_805dae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_805dae(); +} diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl new file mode 100644 index 0000000000..1556ee195c --- /dev/null +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_805dae() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_805dae(); + return; +} + +void fragment_main() { + textureStore_805dae(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_805dae(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl new file mode 100644 index 0000000000..2351b98acc --- /dev/null +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_805dae() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_805dae(); + return; +} + +fragment void fragment_main() { + textureStore_805dae(); + return; +} + +kernel void compute_main() { + textureStore_805dae(); + return; +} + + +tint_5ZPxWj.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm new file mode 100644 index 0000000000..bdb0957a32 --- /dev/null +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_805dae "textureStore_805dae" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_805dae = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_805dae + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_805dae + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_805dae + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl new file mode 100644 index 0000000000..8fd57518db --- /dev/null +++ b/test/intrinsics/gen/textureStore/805dae.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_805dae() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_805dae(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_805dae(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_805dae(); +} diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl new file mode 100644 index 0000000000..c951df77ca --- /dev/null +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_83bcc1() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_83bcc1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_83bcc1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_83bcc1(); +} diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl new file mode 100644 index 0000000000..c03732fd4c --- /dev/null +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_83bcc1() { + arg_0[1] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_83bcc1(); + return; +} + +void fragment_main() { + textureStore_83bcc1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_83bcc1(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl new file mode 100644 index 0000000000..7199f26be1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_83bcc1() { + arg_0.write(uint4(), 1); +} + +vertex void vertex_main() { + textureStore_83bcc1(); + return; +} + +fragment void fragment_main() { + textureStore_83bcc1(); + return; +} + +kernel void compute_main() { + textureStore_83bcc1(); + return; +} + + +tint_ZAiGAn.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm new file mode 100644 index 0000000000..ddd4726017 --- /dev/null +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_83bcc1 "textureStore_83bcc1" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4uint = OpTypeVector %uint 4 + %18 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_83bcc1 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_83bcc1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_83bcc1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_83bcc1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl new file mode 100644 index 0000000000..6a2ee4104c --- /dev/null +++ b/test/intrinsics/gen/textureStore/83bcc1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_83bcc1() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_83bcc1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_83bcc1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_83bcc1(); +} diff --git a/test/intrinsics/gen/textureStore/872747.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl new file mode 100644 index 0000000000..f379316420 --- /dev/null +++ b/test/intrinsics/gen/textureStore/872747.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_872747() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_872747(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_872747(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_872747(); +} diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl new file mode 100644 index 0000000000..26076b1f93 --- /dev/null +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_872747() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_872747(); + return; +} + +void fragment_main() { + textureStore_872747(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_872747(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl new file mode 100644 index 0000000000..eef8b467fe --- /dev/null +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_872747() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_872747(); + return; +} + +fragment void fragment_main() { + textureStore_872747(); + return; +} + +kernel void compute_main() { + textureStore_872747(); + return; +} + + +tint_AifgyA.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm new file mode 100644 index 0000000000..1a704f62e6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_872747 "textureStore_872747" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_872747 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_872747 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_872747 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_872747 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl new file mode 100644 index 0000000000..ff7a941fed --- /dev/null +++ b/test/intrinsics/gen/textureStore/872747.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_872747() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_872747(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_872747(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_872747(); +} diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl new file mode 100644 index 0000000000..9420a69786 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_8e0479() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_8e0479(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_8e0479(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_8e0479(); +} diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl new file mode 100644 index 0000000000..6abe930779 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_8e0479() { + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_8e0479(); + return; +} + +void fragment_main() { + textureStore_8e0479(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_8e0479(); + return; +} + + +tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_hVYKYf:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl new file mode 100644 index 0000000000..9b8b6ce1b5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_8e0479() { + arg_0.write(uint4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_8e0479(); + return; +} + +fragment void fragment_main() { + textureStore_8e0479(); + return; +} + +kernel void compute_main() { + textureStore_8e0479(); + return; +} + + +tint_scQig0.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm new file mode 100644 index 0000000000..8703aad8ee --- /dev/null +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_8e0479 "textureStore_8e0479" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 + %v4uint = OpTypeVector %uint 4 + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_8e0479 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %18 %20 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureStore_8e0479 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_8e0479 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureStore_8e0479 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl new file mode 100644 index 0000000000..5dcee17dac --- /dev/null +++ b/test/intrinsics/gen/textureStore/8e0479.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_8e0479() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_8e0479(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_8e0479(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_8e0479(); +} diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl new file mode 100644 index 0000000000..268f13bfc1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_8f71a1() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_8f71a1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_8f71a1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_8f71a1(); +} diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl new file mode 100644 index 0000000000..1a241c9bf3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_8f71a1() { + arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_8f71a1(); + return; +} + +void fragment_main() { + textureStore_8f71a1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_8f71a1(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl new file mode 100644 index 0000000000..55376ea61c --- /dev/null +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_8f71a1() { + arg_0.write(int4(), int3()); +} + +vertex void vertex_main() { + textureStore_8f71a1(); + return; +} + +fragment void fragment_main() { + textureStore_8f71a1(); + return; +} + +kernel void compute_main() { + textureStore_8f71a1(); + return; +} + + +tint_GBFPAJ.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm new file mode 100644 index 0000000000..1cf50154f8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_8f71a1 "textureStore_8f71a1" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_8f71a1 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_8f71a1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_8f71a1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_8f71a1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl new file mode 100644 index 0000000000..1f64e85fa5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/8f71a1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_8f71a1() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_8f71a1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_8f71a1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_8f71a1(); +} diff --git a/test/intrinsics/gen/textureStore/969534.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl new file mode 100644 index 0000000000..f80fdf454b --- /dev/null +++ b/test/intrinsics/gen/textureStore/969534.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_969534() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_969534(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_969534(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_969534(); +} diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl new file mode 100644 index 0000000000..974bcd9987 --- /dev/null +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_969534() { + arg_0[1] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_969534(); + return; +} + +void fragment_main() { + textureStore_969534(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_969534(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl new file mode 100644 index 0000000000..3f41d7792b --- /dev/null +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_969534() { + arg_0.write(int4(), 1); +} + +vertex void vertex_main() { + textureStore_969534(); + return; +} + +fragment void fragment_main() { + textureStore_969534(); + return; +} + +kernel void compute_main() { + textureStore_969534(); + return; +} + + +tint_9ZMPd8.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm new file mode 100644 index 0000000000..0d2b25b90e --- /dev/null +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_969534 "textureStore_969534" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int_1 = OpConstant %int 1 + %v4int = OpTypeVector %int 4 + %17 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_969534 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_969534 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_969534 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_969534 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl new file mode 100644 index 0000000000..53e571fce2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/969534.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_969534() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_969534(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_969534(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_969534(); +} diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl new file mode 100644 index 0000000000..3ba13a42ca --- /dev/null +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_9a3ecc() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9a3ecc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9a3ecc(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9a3ecc(); +} diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl new file mode 100644 index 0000000000..7252b71988 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_9a3ecc() { + arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_9a3ecc(); + return; +} + +void fragment_main() { + textureStore_9a3ecc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_9a3ecc(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl new file mode 100644 index 0000000000..9275ac3dff --- /dev/null +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_9a3ecc() { + arg_0.write(int4(), int3()); +} + +vertex void vertex_main() { + textureStore_9a3ecc(); + return; +} + +fragment void fragment_main() { + textureStore_9a3ecc(); + return; +} + +kernel void compute_main() { + textureStore_9a3ecc(); + return; +} + + +tint_WyUTaF.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm new file mode 100644 index 0000000000..16257e8a40 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_9a3ecc "textureStore_9a3ecc" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_9a3ecc = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_9a3ecc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_9a3ecc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_9a3ecc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl new file mode 100644 index 0000000000..727c546e20 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9a3ecc.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_9a3ecc() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9a3ecc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9a3ecc(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9a3ecc(); +} diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl new file mode 100644 index 0000000000..4f2a3f3e29 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_9d9cd5() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9d9cd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9d9cd5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9d9cd5(); +} diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl new file mode 100644 index 0000000000..425d0160a2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_9d9cd5() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_9d9cd5(); + return; +} + +void fragment_main() { + textureStore_9d9cd5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_9d9cd5(); + return; +} + + +tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_Ff8P0L:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl new file mode 100644 index 0000000000..7c96ca723f --- /dev/null +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_9d9cd5() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_9d9cd5(); + return; +} + +fragment void fragment_main() { + textureStore_9d9cd5(); + return; +} + +kernel void compute_main() { + textureStore_9d9cd5(); + return; +} + + +tint_7LP9Um.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm new file mode 100644 index 0000000000..43f07cb024 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_9d9cd5 "textureStore_9d9cd5" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rgba32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_9d9cd5 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_9d9cd5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_9d9cd5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_9d9cd5 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl new file mode 100644 index 0000000000..6152a0ce32 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9d9cd5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_9d9cd5() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9d9cd5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9d9cd5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9d9cd5(); +} diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl new file mode 100644 index 0000000000..4e4d687ac9 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_9e3ec5() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9e3ec5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9e3ec5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9e3ec5(); +} diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl new file mode 100644 index 0000000000..99edc0a25b --- /dev/null +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_9e3ec5() { + arg_0[int2(0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_9e3ec5(); + return; +} + +void fragment_main() { + textureStore_9e3ec5(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_9e3ec5(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl new file mode 100644 index 0000000000..eef2b2f67c --- /dev/null +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_9e3ec5() { + arg_0.write(int4(), int2()); +} + +vertex void vertex_main() { + textureStore_9e3ec5(); + return; +} + +fragment void fragment_main() { + textureStore_9e3ec5(); + return; +} + +kernel void compute_main() { + textureStore_9e3ec5(); + return; +} + + +tint_X1Wg39.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm new file mode 100644 index 0000000000..d9595b1c51 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_9e3ec5 "textureStore_9e3ec5" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba16i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_9e3ec5 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_9e3ec5 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_9e3ec5 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_9e3ec5 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl new file mode 100644 index 0000000000..c098780cd8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/9e3ec5.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_9e3ec5() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_9e3ec5(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_9e3ec5(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_9e3ec5(); +} diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl new file mode 100644 index 0000000000..e0a32bd291 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_ac67aa() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ac67aa(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ac67aa(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ac67aa(); +} diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl new file mode 100644 index 0000000000..f8880704d1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_ac67aa() { + arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_ac67aa(); + return; +} + +void fragment_main() { + textureStore_ac67aa(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_ac67aa(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl new file mode 100644 index 0000000000..bd81135b28 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_ac67aa() { + arg_0.write(uint4(), int3()); +} + +vertex void vertex_main() { + textureStore_ac67aa(); + return; +} + +fragment void fragment_main() { + textureStore_ac67aa(); + return; +} + +kernel void compute_main() { + textureStore_ac67aa(); + return; +} + + +tint_uE9lGE.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm new file mode 100644 index 0000000000..9df59a8f78 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.spvasm @@ -0,0 +1,61 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_ac67aa "textureStore_ac67aa" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_ac67aa = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_ac67aa + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_ac67aa + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_ac67aa + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl new file mode 100644 index 0000000000..ebf8cc506f --- /dev/null +++ b/test/intrinsics/gen/textureStore/ac67aa.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_ac67aa() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ac67aa(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ac67aa(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ac67aa(); +} diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl new file mode 100644 index 0000000000..59b894f573 --- /dev/null +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_b706b1() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_b706b1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_b706b1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_b706b1(); +} diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl new file mode 100644 index 0000000000..6c9a134cec --- /dev/null +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_b706b1() { + arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_b706b1(); + return; +} + +void fragment_main() { + textureStore_b706b1(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_b706b1(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl new file mode 100644 index 0000000000..fb1410d656 --- /dev/null +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_b706b1() { + arg_0.write(int4(), int3()); +} + +vertex void vertex_main() { + textureStore_b706b1(); + return; +} + +fragment void fragment_main() { + textureStore_b706b1(); + return; +} + +kernel void compute_main() { + textureStore_b706b1(); + return; +} + + +tint_3D3Uvl.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm new file mode 100644 index 0000000000..b46f7cba35 --- /dev/null +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_b706b1 "textureStore_b706b1" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_b706b1 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_b706b1 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_b706b1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_b706b1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl new file mode 100644 index 0000000000..6f717da7f5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/b706b1.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_b706b1() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_b706b1(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_b706b1(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_b706b1(); +} diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl new file mode 100644 index 0000000000..e7b41fbd64 --- /dev/null +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_bbcb7f() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_bbcb7f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_bbcb7f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_bbcb7f(); +} diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl new file mode 100644 index 0000000000..df0868cb6e --- /dev/null +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_bbcb7f() { + arg_0[int2(0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_bbcb7f(); + return; +} + +void fragment_main() { + textureStore_bbcb7f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_bbcb7f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl new file mode 100644 index 0000000000..b3d7d99248 --- /dev/null +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_bbcb7f() { + arg_0.write(int4(), int2()); +} + +vertex void vertex_main() { + textureStore_bbcb7f(); + return; +} + +fragment void fragment_main() { + textureStore_bbcb7f(); + return; +} + +kernel void compute_main() { + textureStore_bbcb7f(); + return; +} + + +tint_GQyBB7.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm new file mode 100644 index 0000000000..56000e54ee --- /dev/null +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_bbcb7f "textureStore_bbcb7f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_bbcb7f = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_bbcb7f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_bbcb7f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_bbcb7f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl new file mode 100644 index 0000000000..af697b0929 --- /dev/null +++ b/test/intrinsics/gen/textureStore/bbcb7f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_bbcb7f() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_bbcb7f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_bbcb7f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_bbcb7f(); +} diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl new file mode 100644 index 0000000000..6e1aeb99e8 --- /dev/null +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d; +fn textureStore_be6e30() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_be6e30(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_be6e30(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_be6e30(); +} diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl new file mode 100644 index 0000000000..4918e0688b --- /dev/null +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture2D arg_0 : register(u0, space1); + +void textureStore_be6e30() { + arg_0[int2(0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_be6e30(); + return; +} + +void fragment_main() { + textureStore_be6e30(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_be6e30(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl new file mode 100644 index 0000000000..d93712f3cf --- /dev/null +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_be6e30() { + arg_0.write(float4(), int2()); +} + +vertex void vertex_main() { + textureStore_be6e30(); + return; +} + +fragment void fragment_main() { + textureStore_be6e30(); + return; +} + +kernel void compute_main() { + textureStore_be6e30(); + return; +} + + +tint_FLv41D.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm new file mode 100644 index 0000000000..ecf44b0c9a --- /dev/null +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_be6e30 "textureStore_be6e30" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %16 = OpConstantNull %v2int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_be6e30 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_be6e30 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_be6e30 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_be6e30 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl new file mode 100644 index 0000000000..1bd8d78551 --- /dev/null +++ b/test/intrinsics/gen/textureStore/be6e30.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d; + +fn textureStore_be6e30() { + textureStore(arg_0, vec2(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_be6e30(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_be6e30(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_be6e30(); +} diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl new file mode 100644 index 0000000000..62c79394cf --- /dev/null +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_bf775c() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_bf775c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_bf775c(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_bf775c(); +} diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl new file mode 100644 index 0000000000..09c16733e3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_bf775c() { + arg_0[1] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_bf775c(); + return; +} + +void fragment_main() { + textureStore_bf775c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_bf775c(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl new file mode 100644 index 0000000000..4037b9b8ed --- /dev/null +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_bf775c() { + arg_0.write(int4(), 1); +} + +vertex void vertex_main() { + textureStore_bf775c(); + return; +} + +fragment void fragment_main() { + textureStore_bf775c(); + return; +} + +kernel void compute_main() { + textureStore_bf775c(); + return; +} + + +tint_41mJPt.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm new file mode 100644 index 0000000000..8c196e42aa --- /dev/null +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_bf775c "textureStore_bf775c" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int_1 = OpConstant %int 1 + %v4int = OpTypeVector %int 4 + %17 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_bf775c = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_bf775c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_bf775c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_bf775c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl new file mode 100644 index 0000000000..cc479d17a0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/bf775c.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_bf775c() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_bf775c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_bf775c(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_bf775c(); +} diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl new file mode 100644 index 0000000000..3cb1ba0d33 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_c5af1e() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_c5af1e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_c5af1e(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_c5af1e(); +} diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl new file mode 100644 index 0000000000..fb292616cf --- /dev/null +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_c5af1e() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_c5af1e(); + return; +} + +void fragment_main() { + textureStore_c5af1e(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_c5af1e(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl new file mode 100644 index 0000000000..f5bf9cee7e --- /dev/null +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_c5af1e() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_c5af1e(); + return; +} + +fragment void fragment_main() { + textureStore_c5af1e(); + return; +} + +kernel void compute_main() { + textureStore_c5af1e(); + return; +} + + +tint_agFxJI.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm new file mode 100644 index 0000000000..fbd7f691d2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_c5af1e "textureStore_c5af1e" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_c5af1e = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_c5af1e + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_c5af1e + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_c5af1e + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl new file mode 100644 index 0000000000..b973b75eaf --- /dev/null +++ b/test/intrinsics/gen/textureStore/c5af1e.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_c5af1e() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_c5af1e(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_c5af1e(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_c5af1e(); +} diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl new file mode 100644 index 0000000000..e4607bbec9 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c863be.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_c863be() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_c863be(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_c863be(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_c863be(); +} diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl new file mode 100644 index 0000000000..172a759ac2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_c863be() { + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_c863be(); + return; +} + +void fragment_main() { + textureStore_c863be(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_c863be(); + return; +} + + +tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + + +tint_pF4PtE:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = float4(0.0f, 0.0f, 0.0f, 0.0f); + ^ + diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl new file mode 100644 index 0000000000..5c6fb3aba0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_c863be() { + arg_0.write(float4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_c863be(); + return; +} + +fragment void fragment_main() { + textureStore_c863be(); + return; +} + +kernel void compute_main() { + textureStore_c863be(); + return; +} + + +tint_GI47uE.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm new file mode 100644 index 0000000000..765d58a807 --- /dev/null +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_c863be "textureStore_c863be" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 2D 0 1 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4float = OpTypeVector %float 4 + %19 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_c863be = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_c863be + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_c863be + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_c863be + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '14[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl new file mode 100644 index 0000000000..849df749dd --- /dev/null +++ b/test/intrinsics/gen/textureStore/c863be.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_c863be() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_c863be(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_c863be(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_c863be(); +} diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl new file mode 100644 index 0000000000..a29020007f --- /dev/null +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_d73b5c() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_d73b5c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_d73b5c(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_d73b5c(); +} diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl new file mode 100644 index 0000000000..a550f78bf5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_d73b5c() { + arg_0[1] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_d73b5c(); + return; +} + +void fragment_main() { + textureStore_d73b5c(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_d73b5c(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl new file mode 100644 index 0000000000..d62d4084e6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_d73b5c() { + arg_0.write(int4(), 1); +} + +vertex void vertex_main() { + textureStore_d73b5c(); + return; +} + +fragment void fragment_main() { + textureStore_d73b5c(); + return; +} + +kernel void compute_main() { + textureStore_d73b5c(); + return; +} + + +tint_PXkRSh.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm new file mode 100644 index 0000000000..9bd7a5c03e --- /dev/null +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_d73b5c "textureStore_d73b5c" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 1D 0 0 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int_1 = OpConstant %int 1 + %v4int = OpTypeVector %int 4 + %17 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_d73b5c = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_d73b5c + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_d73b5c + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_d73b5c + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl new file mode 100644 index 0000000000..196631374f --- /dev/null +++ b/test/intrinsics/gen/textureStore/d73b5c.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_d73b5c() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_d73b5c(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_d73b5c(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_d73b5c(); +} diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl new file mode 100644 index 0000000000..e4ee1e4df4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_dd7d81() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_dd7d81(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_dd7d81(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_dd7d81(); +} diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl new file mode 100644 index 0000000000..b47a495077 --- /dev/null +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_dd7d81() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_dd7d81(); + return; +} + +void fragment_main() { + textureStore_dd7d81(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_dd7d81(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl new file mode 100644 index 0000000000..935b0c7e6f --- /dev/null +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_dd7d81() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_dd7d81(); + return; +} + +fragment void fragment_main() { + textureStore_dd7d81(); + return; +} + +kernel void compute_main() { + textureStore_dd7d81(); + return; +} + + +tint_liWDoV.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm new file mode 100644 index 0000000000..c3658e7a2a --- /dev/null +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_dd7d81 "textureStore_dd7d81" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_dd7d81 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_dd7d81 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_dd7d81 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_dd7d81 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl new file mode 100644 index 0000000000..7f448d45f0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/dd7d81.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_dd7d81() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_dd7d81(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_dd7d81(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_dd7d81(); +} diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl new file mode 100644 index 0000000000..39d1edad82 --- /dev/null +++ b/test/intrinsics/gen/textureStore/dde364.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_dde364() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_dde364(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_dde364(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_dde364(); +} diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl new file mode 100644 index 0000000000..37c71f375a --- /dev/null +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_dde364() { + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_dde364(); + return; +} + +void fragment_main() { + textureStore_dde364(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_dde364(); + return; +} + + +tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + + +tint_0wYTiw:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = uint4(0u, 0u, 0u, 0u); + ^ + diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl new file mode 100644 index 0000000000..0592dbab3a --- /dev/null +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_dde364() { + arg_0.write(uint4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_dde364(); + return; +} + +fragment void fragment_main() { + textureStore_dde364(); + return; +} + +kernel void compute_main() { + textureStore_dde364(); + return; +} + + +tint_uY3wST.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm new file mode 100644 index 0000000000..6e0667f5ef --- /dev/null +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.spvasm @@ -0,0 +1,70 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_dde364 "textureStore_dde364" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %18 = OpConstantComposite %v3int %int_1 + %v4uint = OpTypeVector %uint 4 + %20 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_dde364 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %18 %20 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %22 = OpLabel + OpStore %tint_pointsize %float_1 + %24 = OpFunctionCall %void %textureStore_dde364 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_dde364 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %29 = OpLabel + %30 = OpFunctionCall %void %textureStore_dde364 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %18 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl new file mode 100644 index 0000000000..d03b4887a0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/dde364.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_dde364() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_dde364(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_dde364(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_dde364(); +} diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl new file mode 100644 index 0000000000..013bd3affb --- /dev/null +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_e885e8() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_e885e8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_e885e8(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_e885e8(); +} diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl new file mode 100644 index 0000000000..110b1fdcbf --- /dev/null +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_e885e8() { + arg_0[1] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_e885e8(); + return; +} + +void fragment_main() { + textureStore_e885e8(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_e885e8(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl new file mode 100644 index 0000000000..deb4e3e6b2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_e885e8() { + arg_0.write(float4(), 1); +} + +vertex void vertex_main() { + textureStore_e885e8(); + return; +} + +fragment void fragment_main() { + textureStore_e885e8(); + return; +} + +kernel void compute_main() { + textureStore_e885e8(); + return; +} + + +tint_EfGtQR.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm new file mode 100644 index 0000000000..0f1837d7c3 --- /dev/null +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 28 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_e885e8 "textureStore_e885e8" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 1D 0 0 0 2 Rgba16f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %17 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_e885e8 = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %int_1 %17 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %19 = OpLabel + OpStore %tint_pointsize %float_1 + %21 = OpFunctionCall %void %textureStore_e885e8 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %23 = OpLabel + %24 = OpFunctionCall %void %textureStore_e885e8 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %26 = OpLabel + %27 = OpFunctionCall %void %textureStore_e885e8 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl new file mode 100644 index 0000000000..e4feafb8d4 --- /dev/null +++ b/test/intrinsics/gen/textureStore/e885e8.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_e885e8() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_e885e8(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_e885e8(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_e885e8(); +} diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl new file mode 100644 index 0000000000..040b104d1a --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_eb702f() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_eb702f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_eb702f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_eb702f(); +} diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl new file mode 100644 index 0000000000..f2f12171ef --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_eb702f() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_eb702f(); + return; +} + +void fragment_main() { + textureStore_eb702f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_eb702f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl new file mode 100644 index 0000000000..eec733b69d --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_eb702f() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_eb702f(); + return; +} + +fragment void fragment_main() { + textureStore_eb702f(); + return; +} + +kernel void compute_main() { + textureStore_eb702f(); + return; +} + + +tint_mkqzHD.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm new file mode 100644 index 0000000000..805163c438 --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_eb702f "textureStore_eb702f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 R32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_eb702f = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_eb702f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_eb702f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_eb702f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl new file mode 100644 index 0000000000..de86b76660 --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb702f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_eb702f() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_eb702f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_eb702f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_eb702f(); +} diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl new file mode 100644 index 0000000000..4aa2004677 --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_eb78b9() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_eb78b9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_eb78b9(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_eb78b9(); +} diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl new file mode 100644 index 0000000000..8a2ccfdb6f --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_eb78b9() { + arg_0[int3(0, 0, 0)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_eb78b9(); + return; +} + +void fragment_main() { + textureStore_eb78b9(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_eb78b9(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl new file mode 100644 index 0000000000..f989309b70 --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_eb78b9() { + arg_0.write(int4(), int3()); +} + +vertex void vertex_main() { + textureStore_eb78b9(); + return; +} + +fragment void fragment_main() { + textureStore_eb78b9(); + return; +} + +kernel void compute_main() { + textureStore_eb78b9(); + return; +} + + +tint_Vp5fbQ.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm new file mode 100644 index 0000000000..2ff5b98472 --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.spvasm @@ -0,0 +1,59 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_eb78b9 "textureStore_eb78b9" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 3D 0 0 0 2 R32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4int = OpTypeVector %int 4 + %18 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_eb78b9 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_eb78b9 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_eb78b9 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_eb78b9 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl new file mode 100644 index 0000000000..eb766662fc --- /dev/null +++ b/test/intrinsics/gen/textureStore/eb78b9.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_eb78b9() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_eb78b9(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_eb78b9(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_eb78b9(); +} diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl new file mode 100644 index 0000000000..a1a7801a07 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_ee6acc() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ee6acc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ee6acc(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ee6acc(); +} diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl new file mode 100644 index 0000000000..a321851ce5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_ee6acc() { + arg_0[int3(0, 0, 0)] = float4(0.0f, 0.0f, 0.0f, 0.0f); +} + +void vertex_main() { + textureStore_ee6acc(); + return; +} + +void fragment_main() { + textureStore_ee6acc(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_ee6acc(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl new file mode 100644 index 0000000000..9ba323da42 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_ee6acc() { + arg_0.write(float4(), int3()); +} + +vertex void vertex_main() { + textureStore_ee6acc(); + return; +} + +fragment void fragment_main() { + textureStore_ee6acc(); + return; +} + +kernel void compute_main() { + textureStore_ee6acc(); + return; +} + + +tint_Cu9b6y.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(float4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm new file mode 100644 index 0000000000..f11aa5cfb5 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_ee6acc "textureStore_ee6acc" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float 3D 0 0 0 2 Rg32f +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %8 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %16 = OpConstantNull %v3int + %v4float = OpTypeVector %float 4 + %18 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%textureStore_ee6acc = OpFunction %void None %8 + %11 = OpLabel + %13 = OpLoad %7 %arg_0 + OpImageWrite %13 %16 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %8 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_ee6acc + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %8 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_ee6acc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %8 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_ee6acc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl new file mode 100644 index 0000000000..3530be4e54 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ee6acc.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_ee6acc() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ee6acc(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ee6acc(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ee6acc(); +} diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl new file mode 100644 index 0000000000..541ee39c20 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_ef9f2f() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ef9f2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ef9f2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ef9f2f(); +} diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl new file mode 100644 index 0000000000..18e4e26428 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_ef9f2f() { + arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_ef9f2f(); + return; +} + +void fragment_main() { + textureStore_ef9f2f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_ef9f2f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl new file mode 100644 index 0000000000..73d6331238 --- /dev/null +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_ef9f2f() { + arg_0.write(uint4(), int3()); +} + +vertex void vertex_main() { + textureStore_ef9f2f(); + return; +} + +fragment void fragment_main() { + textureStore_ef9f2f(); + return; +} + +kernel void compute_main() { + textureStore_ef9f2f(); + return; +} + + +tint_BKGK1I.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm new file mode 100644 index 0000000000..3d68722b9c --- /dev/null +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_ef9f2f "textureStore_ef9f2f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 R32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_ef9f2f = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_ef9f2f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_ef9f2f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_ef9f2f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl new file mode 100644 index 0000000000..f2f20c1abe --- /dev/null +++ b/test/intrinsics/gen/textureStore/ef9f2f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_ef9f2f() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_ef9f2f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_ef9f2f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_ef9f2f(); +} diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl new file mode 100644 index 0000000000..dd8a4fbe4a --- /dev/null +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_3d; +fn textureStore_f8dead() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_f8dead(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_f8dead(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_f8dead(); +} diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl new file mode 100644 index 0000000000..e6687d3c87 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture3D arg_0 : register(u0, space1); + +void textureStore_f8dead() { + arg_0[int3(0, 0, 0)] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_f8dead(); + return; +} + +void fragment_main() { + textureStore_f8dead(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_f8dead(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl new file mode 100644 index 0000000000..fb37bc85f1 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_f8dead() { + arg_0.write(uint4(), int3()); +} + +vertex void vertex_main() { + textureStore_f8dead(); + return; +} + +fragment void fragment_main() { + textureStore_f8dead(); + return; +} + +kernel void compute_main() { + textureStore_f8dead(); + return; +} + + +tint_Agnpo0.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), int3()); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm new file mode 100644 index 0000000000..f421043c21 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_f8dead "textureStore_f8dead" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v3int = OpTypeVector %int 3 + %17 = OpConstantNull %v3int + %v4uint = OpTypeVector %uint 4 + %19 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_f8dead = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_f8dead + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_f8dead + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_f8dead + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl new file mode 100644 index 0000000000..184af581e2 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f8dead.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_3d; + +fn textureStore_f8dead() { + textureStore(arg_0, vec3(), vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_f8dead(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_f8dead(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_f8dead(); +} diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl new file mode 100644 index 0000000000..07e21f92af --- /dev/null +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_f9be83() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_f9be83(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_f9be83(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_f9be83(); +} diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl new file mode 100644 index 0000000000..5314d717f0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_f9be83() { + arg_0[int3(1)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_f9be83(); + return; +} + +void fragment_main() { + textureStore_f9be83(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_f9be83(); + return; +} + + +tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_sMS6hH:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl new file mode 100644 index 0000000000..98469159b6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_f9be83() { + arg_0.write(int4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_f9be83(); + return; +} + +fragment void fragment_main() { + textureStore_f9be83(); + return; +} + +kernel void compute_main() { + textureStore_f9be83(); + return; +} + + +tint_EfgEDv.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm new file mode 100644 index 0000000000..9d3e7de048 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.spvasm @@ -0,0 +1,69 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpCapability StorageImageExtendedFormats + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_f9be83 "textureStore_f9be83" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rg32i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4int = OpTypeVector %int 4 + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_f9be83 = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_f9be83 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_f9be83 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_f9be83 + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl new file mode 100644 index 0000000000..bdc6309b12 --- /dev/null +++ b/test/intrinsics/gen/textureStore/f9be83.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_f9be83() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_f9be83(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_f9be83(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_f9be83(); +} diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl new file mode 100644 index 0000000000..13a69294fa --- /dev/null +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_1d; +fn textureStore_fb9a8f() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_fb9a8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_fb9a8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_fb9a8f(); +} diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl new file mode 100644 index 0000000000..605ed7396b --- /dev/null +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +RWTexture1D arg_0 : register(u0, space1); + +void textureStore_fb9a8f() { + arg_0[1] = uint4(0u, 0u, 0u, 0u); +} + +void vertex_main() { + textureStore_fb9a8f(); + return; +} + +void fragment_main() { + textureStore_fb9a8f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_fb9a8f(); + return; +} + diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl new file mode 100644 index 0000000000..7eede7bdff --- /dev/null +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_fb9a8f() { + arg_0.write(uint4(), 1); +} + +vertex void vertex_main() { + textureStore_fb9a8f(); + return; +} + +fragment void fragment_main() { + textureStore_fb9a8f(); + return; +} + +kernel void compute_main() { + textureStore_fb9a8f(); + return; +} + + +tint_qJBlCj.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(uint4(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm new file mode 100644 index 0000000000..32c9ecbe7a --- /dev/null +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.spvasm @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 29 +; Schema: 0 + OpCapability Shader + OpCapability Image1D + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_fb9a8f "textureStore_fb9a8f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %v4uint = OpTypeVector %uint 4 + %18 = OpConstantNull %v4uint + %float_1 = OpConstant %float 1 +%textureStore_fb9a8f = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %int_1 %18 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %20 = OpLabel + OpStore %tint_pointsize %float_1 + %22 = OpFunctionCall %void %textureStore_fb9a8f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %24 = OpLabel + %25 = OpFunctionCall %void %textureStore_fb9a8f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %27 = OpLabel + %28 = OpFunctionCall %void %textureStore_fb9a8f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl new file mode 100644 index 0000000000..f22a569ccf --- /dev/null +++ b/test/intrinsics/gen/textureStore/fb9a8f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_1d; + +fn textureStore_fb9a8f() { + textureStore(arg_0, 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_fb9a8f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_fb9a8f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_fb9a8f(); +} diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl new file mode 100644 index 0000000000..eac93e42c6 --- /dev/null +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl @@ -0,0 +1,43 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +[[group(1), binding(0)]] var arg_0: texture_storage_2d_array; +fn textureStore_fbf53f() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_fbf53f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_fbf53f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_fbf53f(); +} diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl new file mode 100644 index 0000000000..295677c8ca --- /dev/null +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.hlsl @@ -0,0 +1,42 @@ +SKIP: FAILED + + + +Validation Failure: +RWTexture2DArray arg_0 : register(u0, space1); + +void textureStore_fbf53f() { + arg_0[int3(1)] = int4(0, 0, 0, 0); +} + +void vertex_main() { + textureStore_fbf53f(); + return; +} + +void fragment_main() { + textureStore_fbf53f(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + textureStore_fbf53f(); + return; +} + + +tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + + +tint_gLldW2:4:14: error: too few elements in vector initialization (expected 3 elements, have 1) + arg_0[int3(1)] = int4(0, 0, 0, 0); + ^ + diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl new file mode 100644 index 0000000000..ecabc8c0e0 --- /dev/null +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.msl @@ -0,0 +1,32 @@ +SKIP: FAILED + + + +Validation Failure: +#include + +using namespace metal; +void textureStore_fbf53f() { + arg_0.write(int4(), int2(), 1); +} + +vertex void vertex_main() { + textureStore_fbf53f(); + return; +} + +fragment void fragment_main() { + textureStore_fbf53f(); + return; +} + +kernel void compute_main() { + textureStore_fbf53f(); + return; +} + + +tint_bdJTN4.metal:5:3: error: use of undeclared identifier 'arg_0' + arg_0.write(int4(), int2(), 1); + ^ +1 error generated. diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm new file mode 100644 index 0000000000..eb4f353edc --- /dev/null +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.spvasm @@ -0,0 +1,68 @@ +SKIP: FAILED + +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 30 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %textureStore_fbf53f "textureStore_fbf53f" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 NonReadable + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int 2D 0 1 0 2 Rgba8i +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %void = OpTypeVoid + %9 = OpTypeFunction %void + %v3int = OpTypeVector %int 3 + %int_1 = OpConstant %int 1 + %17 = OpConstantComposite %v3int %int_1 + %v4int = OpTypeVector %int 4 + %19 = OpConstantNull %v4int + %float_1 = OpConstant %float 1 +%textureStore_fbf53f = OpFunction %void None %9 + %12 = OpLabel + %14 = OpLoad %7 %arg_0 + OpImageWrite %14 %17 %19 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %9 + %21 = OpLabel + OpStore %tint_pointsize %float_1 + %23 = OpFunctionCall %void %textureStore_fbf53f + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %9 + %25 = OpLabel + %26 = OpFunctionCall %void %textureStore_fbf53f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %9 + %28 = OpLabel + %29 = OpFunctionCall %void %textureStore_fbf53f + OpReturn + OpFunctionEnd + + +Validation Failure: +1:1: OpConstantComposite Constituent count does not match Result Type '15[%v3int]'s vector component count. + %17 = OpConstantComposite %v3int %int_1 + diff --git a/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl new file mode 100644 index 0000000000..b19b0a4d0b --- /dev/null +++ b/test/intrinsics/gen/textureStore/fbf53f.wgsl.expected.wgsl @@ -0,0 +1,20 @@ +[[group(1), binding(0)]] var arg_0 : [[access(write)]] texture_storage_2d_array; + +fn textureStore_fbf53f() { + textureStore(arg_0, vec2(), 1, vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + textureStore_fbf53f(); +} + +[[stage(fragment)]] +fn fragment_main() { + textureStore_fbf53f(); +} + +[[stage(compute)]] +fn compute_main() { + textureStore_fbf53f(); +} diff --git a/test/intrinsics/gen/trunc/562d05.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl new file mode 100644 index 0000000000..3358cfff15 --- /dev/null +++ b/test/intrinsics/gen/trunc/562d05.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn trunc_562d05() { + var res: vec3 = trunc(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_562d05(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_562d05(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_562d05(); +} diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl new file mode 100644 index 0000000000..e1bad912c1 --- /dev/null +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void trunc_562d05() { + float3 res = trunc(float3(0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + trunc_562d05(); + return; +} + +void fragment_main() { + trunc_562d05(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + trunc_562d05(); + return; +} + diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl new file mode 100644 index 0000000000..5ed7816eb9 --- /dev/null +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void trunc_562d05() { + float3 res = trunc(float3()); +} + +vertex void vertex_main() { + trunc_562d05(); + return; +} + +fragment void fragment_main() { + trunc_562d05(); + return; +} + +kernel void compute_main() { + trunc_562d05(); + return; +} + diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm new file mode 100644 index 0000000000..ed7d4b7817 --- /dev/null +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %trunc_562d05 "trunc_562d05" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v3float = OpTypeVector %float 3 + %12 = OpConstantNull %v3float +%_ptr_Function_v3float = OpTypePointer Function %v3float + %float_1 = OpConstant %float 1 +%trunc_562d05 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v3float Function %12 + %9 = OpExtInst %v3float %11 Trunc %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %trunc_562d05 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %trunc_562d05 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %trunc_562d05 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl new file mode 100644 index 0000000000..b1b63479e6 --- /dev/null +++ b/test/intrinsics/gen/trunc/562d05.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn trunc_562d05() { + var res : vec3 = trunc(vec3()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_562d05(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_562d05(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_562d05(); +} diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl new file mode 100644 index 0000000000..f52677e61f --- /dev/null +++ b/test/intrinsics/gen/trunc/e183aa.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn trunc_e183aa() { + var res: vec4 = trunc(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_e183aa(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_e183aa(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_e183aa(); +} diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl new file mode 100644 index 0000000000..8f55919f46 --- /dev/null +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void trunc_e183aa() { + float4 res = trunc(float4(0.0f, 0.0f, 0.0f, 0.0f)); +} + +void vertex_main() { + trunc_e183aa(); + return; +} + +void fragment_main() { + trunc_e183aa(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + trunc_e183aa(); + return; +} + diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl new file mode 100644 index 0000000000..7b480264e0 --- /dev/null +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void trunc_e183aa() { + float4 res = trunc(float4()); +} + +vertex void vertex_main() { + trunc_e183aa(); + return; +} + +fragment void fragment_main() { + trunc_e183aa(); + return; +} + +kernel void compute_main() { + trunc_e183aa(); + return; +} + diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm new file mode 100644 index 0000000000..01065e1299 --- /dev/null +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %trunc_e183aa "trunc_e183aa" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %12 = OpConstantNull %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_1 = OpConstant %float 1 +%trunc_e183aa = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %12 + %9 = OpExtInst %v4float %11 Trunc %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %trunc_e183aa + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %trunc_e183aa + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %trunc_e183aa + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl new file mode 100644 index 0000000000..f41ba24d98 --- /dev/null +++ b/test/intrinsics/gen/trunc/e183aa.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn trunc_e183aa() { + var res : vec4 = trunc(vec4()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_e183aa(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_e183aa(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_e183aa(); +} diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl new file mode 100644 index 0000000000..3487eb3e52 --- /dev/null +++ b/test/intrinsics/gen/trunc/eb83df.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn trunc_eb83df() { + var res: f32 = trunc(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_eb83df(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_eb83df(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_eb83df(); +} diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl new file mode 100644 index 0000000000..0dc4fc40aa --- /dev/null +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void trunc_eb83df() { + float res = trunc(1.0f); +} + +void vertex_main() { + trunc_eb83df(); + return; +} + +void fragment_main() { + trunc_eb83df(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + trunc_eb83df(); + return; +} + diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl new file mode 100644 index 0000000000..803fea72f6 --- /dev/null +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void trunc_eb83df() { + float res = trunc(1.0f); +} + +vertex void vertex_main() { + trunc_eb83df(); + return; +} + +fragment void fragment_main() { + trunc_eb83df(); + return; +} + +kernel void compute_main() { + trunc_eb83df(); + return; +} + diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm new file mode 100644 index 0000000000..73577d1c0f --- /dev/null +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.spvasm @@ -0,0 +1,51 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %10 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %trunc_eb83df "trunc_eb83df" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %float_1 = OpConstant %float 1 +%_ptr_Function_float = OpTypePointer Function %float +%trunc_eb83df = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_float Function %4 + %9 = OpExtInst %float %10 Trunc %float_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %15 = OpLabel + OpStore %tint_pointsize %float_1 + %16 = OpFunctionCall %void %trunc_eb83df + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %18 = OpLabel + %19 = OpFunctionCall %void %trunc_eb83df + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %21 = OpLabel + %22 = OpFunctionCall %void %trunc_eb83df + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl new file mode 100644 index 0000000000..ebf5104490 --- /dev/null +++ b/test/intrinsics/gen/trunc/eb83df.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn trunc_eb83df() { + var res : f32 = trunc(1.0); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_eb83df(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_eb83df(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_eb83df(); +} diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl new file mode 100644 index 0000000000..0a3c51a5d1 --- /dev/null +++ b/test/intrinsics/gen/trunc/f370d3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn trunc_f370d3() { + var res: vec2 = trunc(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_f370d3(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_f370d3(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_f370d3(); +} diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl new file mode 100644 index 0000000000..92854e2ea6 --- /dev/null +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.hlsl @@ -0,0 +1,20 @@ +void trunc_f370d3() { + float2 res = trunc(float2(0.0f, 0.0f)); +} + +void vertex_main() { + trunc_f370d3(); + return; +} + +void fragment_main() { + trunc_f370d3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + trunc_f370d3(); + return; +} + diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl new file mode 100644 index 0000000000..b5ec5fde0b --- /dev/null +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void trunc_f370d3() { + float2 res = trunc(float2()); +} + +vertex void vertex_main() { + trunc_f370d3(); + return; +} + +fragment void fragment_main() { + trunc_f370d3(); + return; +} + +kernel void compute_main() { + trunc_f370d3(); + return; +} + diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm new file mode 100644 index 0000000000..626914436e --- /dev/null +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.spvasm @@ -0,0 +1,53 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 25 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %trunc_f370d3 "trunc_f370d3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %12 = OpConstantNull %v2float +%_ptr_Function_v2float = OpTypePointer Function %v2float + %float_1 = OpConstant %float 1 +%trunc_f370d3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %12 + %9 = OpExtInst %v2float %11 Trunc %12 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %16 = OpLabel + OpStore %tint_pointsize %float_1 + %18 = OpFunctionCall %void %trunc_f370d3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %20 = OpLabel + %21 = OpFunctionCall %void %trunc_f370d3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %23 = OpLabel + %24 = OpFunctionCall %void %trunc_f370d3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl new file mode 100644 index 0000000000..35a6565df7 --- /dev/null +++ b/test/intrinsics/gen/trunc/f370d3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn trunc_f370d3() { + var res : vec2 = trunc(vec2()); +} + +[[stage(vertex)]] +fn vertex_main() { + trunc_f370d3(); +} + +[[stage(fragment)]] +fn fragment_main() { + trunc_f370d3(); +} + +[[stage(compute)]] +fn compute_main() { + trunc_f370d3(); +} diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl new file mode 100644 index 0000000000..93e4b1f094 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn unpack2x16float_32a5cf() { + var res: vec2 = unpack2x16float(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16float_32a5cf(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16float_32a5cf(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16float_32a5cf(); +} diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl new file mode 100644 index 0000000000..e675e28d01 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.hlsl @@ -0,0 +1,21 @@ +void unpack2x16float_32a5cf() { + uint tint_tmp = 1u; +float2 res = f16tof32(uint2(tint_tmp & 0xffff, tint_tmp >> 16)); +} + +void vertex_main() { + unpack2x16float_32a5cf(); + return; +} + +void fragment_main() { + unpack2x16float_32a5cf(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + unpack2x16float_32a5cf(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl new file mode 100644 index 0000000000..8f4f001717 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void unpack2x16float_32a5cf() { + float2 res = float2(as_type(1u)); +} + +vertex void vertex_main() { + unpack2x16float_32a5cf(); + return; +} + +fragment void fragment_main() { + unpack2x16float_32a5cf(); + return; +} + +kernel void compute_main() { + unpack2x16float_32a5cf(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm new file mode 100644 index 0000000000..0b608bacda --- /dev/null +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %unpack2x16float_32a5cf "unpack2x16float_32a5cf" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_v2float = OpTypePointer Function %v2float + %16 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%unpack2x16float_32a5cf = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %9 = OpExtInst %v2float %11 UnpackHalf2x16 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %unpack2x16float_32a5cf + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %unpack2x16float_32a5cf + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %unpack2x16float_32a5cf + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl new file mode 100644 index 0000000000..d310518f14 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16float/32a5cf.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn unpack2x16float_32a5cf() { + var res : vec2 = unpack2x16float(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16float_32a5cf(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16float_32a5cf(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16float_32a5cf(); +} diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl new file mode 100644 index 0000000000..548843659b --- /dev/null +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn unpack2x16snorm_b4aea6() { + var res: vec2 = unpack2x16snorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16snorm_b4aea6(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16snorm_b4aea6(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16snorm_b4aea6(); +} diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl new file mode 100644 index 0000000000..9a90dc921d --- /dev/null +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +void unpack2x16snorm_b4aea6() { + int tint_tmp_1 = int(1u); +int2 tint_tmp = int2(tint_tmp_1 << 16, tint_tmp_1) >> 16; +float2 res = clamp(float2(tint_tmp) / 32767.0, -1.0, 1.0); +} + +void vertex_main() { + unpack2x16snorm_b4aea6(); + return; +} + +void fragment_main() { + unpack2x16snorm_b4aea6(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + unpack2x16snorm_b4aea6(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl new file mode 100644 index 0000000000..c315dce002 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void unpack2x16snorm_b4aea6() { + float2 res = unpack_snorm2x16_to_float(1u); +} + +vertex void vertex_main() { + unpack2x16snorm_b4aea6(); + return; +} + +fragment void fragment_main() { + unpack2x16snorm_b4aea6(); + return; +} + +kernel void compute_main() { + unpack2x16snorm_b4aea6(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm new file mode 100644 index 0000000000..c52f991958 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %unpack2x16snorm_b4aea6 "unpack2x16snorm_b4aea6" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_v2float = OpTypePointer Function %v2float + %16 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%unpack2x16snorm_b4aea6 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %9 = OpExtInst %v2float %11 UnpackSnorm2x16 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %unpack2x16snorm_b4aea6 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %unpack2x16snorm_b4aea6 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %unpack2x16snorm_b4aea6 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl new file mode 100644 index 0000000000..662770e6cf --- /dev/null +++ b/test/intrinsics/gen/unpack2x16snorm/b4aea6.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn unpack2x16snorm_b4aea6() { + var res : vec2 = unpack2x16snorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16snorm_b4aea6(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16snorm_b4aea6(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16snorm_b4aea6(); +} diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl new file mode 100644 index 0000000000..4b22886ccf --- /dev/null +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn unpack2x16unorm_7699c0() { + var res: vec2 = unpack2x16unorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16unorm_7699c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16unorm_7699c0(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16unorm_7699c0(); +} diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl new file mode 100644 index 0000000000..cb6aef9bba --- /dev/null +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +void unpack2x16unorm_7699c0() { + uint tint_tmp_1 = 1u; +uint2 tint_tmp = uint2(tint_tmp_1 & 0xffff, tint_tmp_1 >> 16); +float2 res = float2(tint_tmp) / 65535.0; +} + +void vertex_main() { + unpack2x16unorm_7699c0(); + return; +} + +void fragment_main() { + unpack2x16unorm_7699c0(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + unpack2x16unorm_7699c0(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl new file mode 100644 index 0000000000..9d652668f3 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void unpack2x16unorm_7699c0() { + float2 res = unpack_unorm2x16_to_float(1u); +} + +vertex void vertex_main() { + unpack2x16unorm_7699c0(); + return; +} + +fragment void fragment_main() { + unpack2x16unorm_7699c0(); + return; +} + +kernel void compute_main() { + unpack2x16unorm_7699c0(); + return; +} + diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm new file mode 100644 index 0000000000..1df109e9d3 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %unpack2x16unorm_7699c0 "unpack2x16unorm_7699c0" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_v2float = OpTypePointer Function %v2float + %16 = OpConstantNull %v2float + %float_1 = OpConstant %float 1 +%unpack2x16unorm_7699c0 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v2float Function %16 + %9 = OpExtInst %v2float %11 UnpackUnorm2x16 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %unpack2x16unorm_7699c0 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %unpack2x16unorm_7699c0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %unpack2x16unorm_7699c0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl new file mode 100644 index 0000000000..819996c2a0 --- /dev/null +++ b/test/intrinsics/gen/unpack2x16unorm/7699c0.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn unpack2x16unorm_7699c0() { + var res : vec2 = unpack2x16unorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack2x16unorm_7699c0(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack2x16unorm_7699c0(); +} + +[[stage(compute)]] +fn compute_main() { + unpack2x16unorm_7699c0(); +} diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl new file mode 100644 index 0000000000..9c703423f2 --- /dev/null +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn unpack4x8snorm_523fb3() { + var res: vec4 = unpack4x8snorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack4x8snorm_523fb3(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack4x8snorm_523fb3(); +} + +[[stage(compute)]] +fn compute_main() { + unpack4x8snorm_523fb3(); +} diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl new file mode 100644 index 0000000000..e9009fca85 --- /dev/null +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +void unpack4x8snorm_523fb3() { + int tint_tmp_1 = int(1u); +int4 tint_tmp = int4(tint_tmp_1 << 24, tint_tmp_1 << 16, tint_tmp_1 << 8, tint_tmp_1) >> 24; +float4 res = clamp(float4(tint_tmp) / 127.0, -1.0, 1.0); +} + +void vertex_main() { + unpack4x8snorm_523fb3(); + return; +} + +void fragment_main() { + unpack4x8snorm_523fb3(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + unpack4x8snorm_523fb3(); + return; +} + diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl new file mode 100644 index 0000000000..1912c1a5cd --- /dev/null +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void unpack4x8snorm_523fb3() { + float4 res = unpack_snorm4x8_to_float(1u); +} + +vertex void vertex_main() { + unpack4x8snorm_523fb3(); + return; +} + +fragment void fragment_main() { + unpack4x8snorm_523fb3(); + return; +} + +kernel void compute_main() { + unpack4x8snorm_523fb3(); + return; +} + diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm new file mode 100644 index 0000000000..3fc6309f7f --- /dev/null +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %unpack4x8snorm_523fb3 "unpack4x8snorm_523fb3" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %16 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%unpack4x8snorm_523fb3 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %16 + %9 = OpExtInst %v4float %11 UnpackSnorm4x8 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %unpack4x8snorm_523fb3 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %unpack4x8snorm_523fb3 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %unpack4x8snorm_523fb3 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl new file mode 100644 index 0000000000..6352fdc782 --- /dev/null +++ b/test/intrinsics/gen/unpack4x8snorm/523fb3.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn unpack4x8snorm_523fb3() { + var res : vec4 = unpack4x8snorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack4x8snorm_523fb3(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack4x8snorm_523fb3(); +} + +[[stage(compute)]] +fn compute_main() { + unpack4x8snorm_523fb3(); +} diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl new file mode 100644 index 0000000000..6bab108810 --- /dev/null +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl @@ -0,0 +1,42 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn unpack4x8unorm_750c74() { + var res: vec4 = unpack4x8unorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack4x8unorm_750c74(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack4x8unorm_750c74(); +} + +[[stage(compute)]] +fn compute_main() { + unpack4x8unorm_750c74(); +} diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl new file mode 100644 index 0000000000..bb4345719e --- /dev/null +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.hlsl @@ -0,0 +1,22 @@ +void unpack4x8unorm_750c74() { + uint tint_tmp_1 = 1u; +uint4 tint_tmp = uint4(tint_tmp_1 & 0xff, (tint_tmp_1 >> 8) & 0xff, (tint_tmp_1 >> 16) & 0xff, tint_tmp_1 >> 24); +float4 res = float4(tint_tmp) / 255.0; +} + +void vertex_main() { + unpack4x8unorm_750c74(); + return; +} + +void fragment_main() { + unpack4x8unorm_750c74(); + return; +} + +[numthreads(1, 1, 1)] +void compute_main() { + unpack4x8unorm_750c74(); + return; +} + diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl new file mode 100644 index 0000000000..9b8a802988 --- /dev/null +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.msl @@ -0,0 +1,22 @@ +#include + +using namespace metal; +void unpack4x8unorm_750c74() { + float4 res = unpack_unorm4x8_to_float(1u); +} + +vertex void vertex_main() { + unpack4x8unorm_750c74(); + return; +} + +fragment void fragment_main() { + unpack4x8unorm_750c74(); + return; +} + +kernel void compute_main() { + unpack4x8unorm_750c74(); + return; +} + diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm new file mode 100644 index 0000000000..6b420e3d3f --- /dev/null +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.spvasm @@ -0,0 +1,55 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 27 +; Schema: 0 + OpCapability Shader + %11 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %unpack4x8unorm_750c74 "unpack4x8unorm_750c74" + OpName %res "res" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %void = OpTypeVoid + %5 = OpTypeFunction %void + %v4float = OpTypeVector %float 4 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %16 = OpConstantNull %v4float + %float_1 = OpConstant %float 1 +%unpack4x8unorm_750c74 = OpFunction %void None %5 + %8 = OpLabel + %res = OpVariable %_ptr_Function_v4float Function %16 + %9 = OpExtInst %v4float %11 UnpackUnorm4x8 %uint_1 + OpStore %res %9 + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %5 + %18 = OpLabel + OpStore %tint_pointsize %float_1 + %20 = OpFunctionCall %void %unpack4x8unorm_750c74 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %5 + %22 = OpLabel + %23 = OpFunctionCall %void %unpack4x8unorm_750c74 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %5 + %25 = OpLabel + %26 = OpFunctionCall %void %unpack4x8unorm_750c74 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl new file mode 100644 index 0000000000..53e09726cb --- /dev/null +++ b/test/intrinsics/gen/unpack4x8unorm/750c74.wgsl.expected.wgsl @@ -0,0 +1,18 @@ +fn unpack4x8unorm_750c74() { + var res : vec4 = unpack4x8unorm(1u); +} + +[[stage(vertex)]] +fn vertex_main() { + unpack4x8unorm_750c74(); +} + +[[stage(fragment)]] +fn fragment_main() { + unpack4x8unorm_750c74(); +} + +[[stage(compute)]] +fn compute_main() { + unpack4x8unorm_750c74(); +} diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl new file mode 100644 index 0000000000..287246c06d --- /dev/null +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl @@ -0,0 +1,32 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//////////////////////////////////////////////////////////////////////////////// +// File generated by tools/intrinsic-gen +// using the template: +// test/intrinsics/intrinsics.wgsl.tmpl +// and the intrinsic defintion file: +// src/intrinsics.def +// +// Do not modify this file directly +//////////////////////////////////////////////////////////////////////////////// + +fn workgroupBarrier_a17f7f() { + workgroupBarrier(); +} + +[[stage(compute)]] +fn compute_main() { + workgroupBarrier_a17f7f(); +} diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl new file mode 100644 index 0000000000..6d12710bda --- /dev/null +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.hlsl @@ -0,0 +1,10 @@ +void workgroupBarrier_a17f7f() { + GroupMemoryBarrierWithGroupSync(); +} + +[numthreads(1, 1, 1)] +void compute_main() { + workgroupBarrier_a17f7f(); + return; +} + diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl new file mode 100644 index 0000000000..a3dcb47c00 --- /dev/null +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.msl @@ -0,0 +1,12 @@ +#include + +using namespace metal; +void workgroupBarrier_a17f7f() { + threadgroup_barrier(mem_flags::mem_threadgroup); +} + +kernel void compute_main() { + workgroupBarrier_a17f7f(); + return; +} + diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm new file mode 100644 index 0000000000..dfea5e8a20 --- /dev/null +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.spvasm @@ -0,0 +1,26 @@ +; SPIR-V +; Version: 1.3 +; Generator: Google Tint Compiler; 0 +; Bound: 12 +; Schema: 0 + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %workgroupBarrier_a17f7f "workgroupBarrier_a17f7f" + OpName %compute_main "compute_main" + %void = OpTypeVoid + %1 = OpTypeFunction %void + %uint = OpTypeInt 32 0 + %uint_2 = OpConstant %uint 2 + %uint_264 = OpConstant %uint 264 +%workgroupBarrier_a17f7f = OpFunction %void None %1 + %4 = OpLabel + OpControlBarrier %uint_2 %uint_2 %uint_264 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %1 + %10 = OpLabel + %11 = OpFunctionCall %void %workgroupBarrier_a17f7f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl new file mode 100644 index 0000000000..055d079ea9 --- /dev/null +++ b/test/intrinsics/gen/workgroupBarrier/a17f7f.wgsl.expected.wgsl @@ -0,0 +1,8 @@ +fn workgroupBarrier_a17f7f() { + workgroupBarrier(); +} + +[[stage(compute)]] +fn compute_main() { + workgroupBarrier_a17f7f(); +} diff --git a/test/intrinsics/intrinsics.wgsl.tmpl b/test/intrinsics/intrinsics.wgsl.tmpl new file mode 100644 index 0000000000..c23515fdcf --- /dev/null +++ b/test/intrinsics/intrinsics.wgsl.tmpl @@ -0,0 +1,179 @@ +{{- /* +-------------------------------------------------------------------------------- +Template file for use with tools/intrinsic-gen to generate the wgsl files in the +./gen/... subdirectories + +See: +* tools/cmd/intrinsic-gen/gen for structures used by this template +* https://golang.org/pkg/text/template/ for documentation on the template syntax +-------------------------------------------------------------------------------- +*/ -}} + +{{- /* For each permutation of each overload of each function... */ -}} +{{- range .Sem.Functions -}} +{{- range .Overloads -}} +{{- range Permute . -}} +{{- /* Generate a ./gen//.wgsl file using + the Permutation macro defined below */ -}} +{{- $file := printf "./gen/%v/%v.wgsl" .Function.Name .Hash -}} +{{- $content := Eval "Permutation" . -}} +{{- WriteFile $file $content -}} +{{- end }} +{{- end }} +{{- end }} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "Permutation" -}} +{{- /* Emits the body of the intrinsic permuation .wgsl file */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- $function := .Function.Name -}} +{{- $permutation := printf "%v_%v" $function .Hash -}} +{{- $args := Map -}} + +{{- /* Generate a storage buffer for runtime sized array parameters */ -}} +{{- if (Eval "HasStorageBufferArgs" .) -}} +[[block]] +struct SB { +{{- range $i, $p := .Parameters }} +{{- $class := Eval "StorageClass" $p.Type -}} +{{- if eq "STORAGE_BUFFER" $class }} + arg_{{$i}}: {{template "Type" $p.Type}}; +{{ $args.Put $i (printf "sb.arg_%v" $i) -}} +{{- end -}} +{{- end -}} +}; +[[group(0), binding(0)]] var sb : [[access(read)]] SB; +{{ end -}} + +{{- /* Generate module-scoped resource variables (textures, samplers, etc) */ -}} +{{- range $i, $p := .Parameters }} +{{- $class := Eval "StorageClass" $p.Type -}} +{{- if eq "RESOURCE" $class -}} + [[group(1), binding({{$i}})]] var arg_{{$i}}: {{template "Type" $p.Type}}; +{{ $args.Put $i (printf "arg_%v" $i) -}} +{{- end -}} +{{- end -}} + +{{- /* Generate the function that calls the intrinsic */ -}} +fn {{$permutation}}() { +{{/* Build the parameters either as 'var' or inline values */ -}} +{{- range $i, $p := .Parameters -}} +{{- $class := Eval "StorageClass" $p.Type -}} +{{- if eq "PRIVATE" $class -}} +{{- if eq "ptr" $p.Type.Target.Name -}} +{{- /*indent*/}} var arg_{{$i}}: {{template "Type" index $p.Type.TemplateArguments 1}}; +{{ $args.Put $i (printf "&arg_%v" $i) -}} +{{- else -}} +{{- $args.Put $i (Eval "ValueOf" $p.Type) -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- /* Make the call to the intrinsic */ -}} +{{- /*indent*/}} {{/*indent*/ -}} +{{- if .ReturnType -}} + var res: {{template "Type" .ReturnType}} = {{/* preserve space after = */ -}} +{{- end -}} + {{$function}}( +{{- range $i, $p := .Parameters -}} +{{- if $i -}}, {{end}}{{$args.Get $i -}} +{{- end -}} + ); +} +{{/*new line*/ -}} + +{{- if .CanBeUsedInStage.Vertex }} +[[stage(vertex)]] +fn vertex_main() { + {{$permutation}}(); +} +{{ end -}} + +{{- if .CanBeUsedInStage.Fragment }} +[[stage(fragment)]] +fn fragment_main() { + {{$permutation}}(); +} +{{ end -}} + +{{- if .CanBeUsedInStage.Compute }} +[[stage(compute)]] +fn compute_main() { + {{$permutation}}(); +} +{{ end -}} + +{{- end -}} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "HasStorageBufferArgs" -}} +{{- /* Returns a non-empty string if the given overload has parameters */ -}} +{{- /* that are in the STORAGE_BUFFER storage class */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- range $i, $p := .Parameters }} +{{- $class := Eval "StorageClass" $p.Type -}} +{{- if eq "STORAGE_BUFFER" $class -}}1 +{{ end -}} +{{- end -}} +{{- end -}} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "StorageClass" -}} +{{- /* Returns the storage classs STORAGE_BUFFER, RESOURCE, or PRIVATE */ -}} +{{- /* for the given Fully Qualified Name */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- $name := .Target.Name -}} +{{- if eq $name "array" -}}STORAGE_BUFFER +{{- else if HasPrefix $name "texture" -}}RESOURCE +{{- else if HasPrefix $name "sampler" -}}RESOURCE +{{- else -}}PRIVATE +{{- end -}} +{{- end -}} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "ValueOf" -}} +{{- /* Returns a value of the given Fully Qualified Name argument */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- if eq .Target.Name "i32" -}}1 +{{- else if eq .Target.Name "u32" -}}1u +{{- else if eq .Target.Name "f32" -}}1.0 +{{- else -}}{{template "Type" .}}() +{{- end -}} +{{- end -}} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "Type" -}} +{{- /* Emits the WGSL for the Fully Qualified Name argument */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- if IsType .Target -}} +{{- if eq .Target.Name "vec" -}}vec{{index .TemplateArguments 0}}<{{template "Type" index .TemplateArguments 1}}> +{{- else if eq .Target.Name "mat" -}}mat{{index .TemplateArguments 0}}x{{index .TemplateArguments 1}}<{{template "Type" index .TemplateArguments 2}}> +{{- else -}}{{.Target.Name}}{{template "TemplateArguments" .TemplateArguments}} +{{- end -}} +{{- else if IsEnumEntry .Target -}}{{.Target.Name}} +{{- else if IsEnumMatcher .Target -}}{{(index .Target.Options 0).Name}} +{{- else -}} +{{- end -}} +{{- end -}} + + +{{- /* ------------------------------------------------------------------ */ -}} +{{- define "TemplateArguments" -}} +{{- /* Emits the WGSL for the template argument list */ -}} +{{- /* ------------------------------------------------------------------ */ -}} +{{- if . -}} +< +{{- range $i, $a := . -}} +{{- if $i -}}, {{ end -}} +{{- if IsInt $a -}}{{- . -}} +{{- else -}}{{- template "Type" $a -}} +{{- end -}} +{{- end -}} +> +{{- end -}} +{{- end -}} diff --git a/tools/src/cmd/intrinsic-gen/gen/generate.go b/tools/src/cmd/intrinsic-gen/gen/generate.go index 6dad43b969..8eb26660ec 100644 --- a/tools/src/cmd/intrinsic-gen/gen/generate.go +++ b/tools/src/cmd/intrinsic-gen/gen/generate.go @@ -30,6 +30,7 @@ type generator struct { t *template.Template cached struct { intrinsicTable *IntrinsicTable // lazily built by intrinsicTable() + permuter *Permuter // lazily built by permute() } } @@ -68,6 +69,7 @@ func (g *generator) generate(tmpl string, w io.Writer, writeFile WriteFile) erro "IsFirstIn": isFirstIn, "IsLastIn": isLastIn, "IntrinsicTable": g.intrinsicTable, + "Permute": g.permute, "Eval": g.eval, "WriteFile": func(relpath, content string) (string, error) { return "", writeFile(relpath, content) }, }).Option("missingkey=error"). @@ -108,6 +110,19 @@ func (g *generator) intrinsicTable() (*IntrinsicTable, error) { return g.cached.intrinsicTable, nil } +// permute lazily calls buildPermuter(), caching the result for repeated +// calls, then passes the argument to Permutator.Permute() +func (g *generator) permute(overload *sem.Overload) ([]Permutation, error) { + if g.cached.permuter == nil { + var err error + g.cached.permuter, err = buildPermuter(g.s) + if err != nil { + return nil, err + } + } + return g.cached.permuter.Permute(overload) +} + // Map is a simple generic key-value map, which can be used in the template type Map map[interface{}]interface{} diff --git a/tools/src/cmd/intrinsic-gen/gen/permutate.go b/tools/src/cmd/intrinsic-gen/gen/permutate.go new file mode 100644 index 0000000000..8d84ad5aa8 --- /dev/null +++ b/tools/src/cmd/intrinsic-gen/gen/permutate.go @@ -0,0 +1,349 @@ +// Copyright 2021 The Tint Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gen + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + "strings" + + "dawn.googlesource.com/tint/tools/src/cmd/intrinsic-gen/sem" + "dawn.googlesource.com/tint/tools/src/fileutils" +) + +// Permuter generates permutations of intrinsic overloads +type Permuter struct { + sem *sem.Sem + allTypes []sem.FullyQualifiedName +} + +// buildPermuter returns a new initialized Permuter +func buildPermuter(s *sem.Sem) (*Permuter, error) { + // allTypes are the list of FQNs that are used for open, unconstrained types + allTypes := []sem.FullyQualifiedName{} + for _, ty := range s.Types { + if len(ty.TemplateParams) > 0 { + // Ignore aggregate types for now. + // TODO(bclayton): Support a limited set of aggregate types + continue + } + allTypes = append(allTypes, sem.FullyQualifiedName{Target: ty}) + } + return &Permuter{ + sem: s, + allTypes: allTypes, + }, nil +} + +// Permutation describes a single permutation of an overload +type Permutation struct { + sem.Overload // The permutated overload signature + Desc string // Description of the overload + Hash string // Hash of the overload +} + +// Permute generates a set of permutations for the given intrinsic overload +func (p *Permuter) Permute(overload *sem.Overload) ([]Permutation, error) { + state := permutationState{ + Permuter: p, + closedTypes: map[sem.TemplateParam]sem.FullyQualifiedName{}, + closedNumbers: map[sem.TemplateParam]interface{}{}, + parameters: map[int]sem.FullyQualifiedName{}, + } + + out := []Permutation{} + + // Map of hash to permutation description. Used to detect collisions. + hashes := map[string]string{} + + // permutate appends a permutation to out. + // permutate may be chained to generate N-dimensional permutations. + permutate := func() error { + o := sem.Overload{ + Decl: overload.Decl, + Function: overload.Function, + CanBeUsedInStage: overload.CanBeUsedInStage, + } + for i, p := range overload.Parameters { + ty := state.parameters[i] + if !validate(ty) { + return nil + } + o.Parameters = append(o.Parameters, sem.Parameter{ + Name: p.Name, + Type: ty, + }) + } + if overload.ReturnType != nil { + retTys, err := state.permutateFQN(*overload.ReturnType) + if err != nil { + return fmt.Errorf("while permutating return type: %w", err) + } + if len(retTys) != 1 { + return fmt.Errorf("result type not pinned") + } + o.ReturnType = &retTys[0] + } + desc := fmt.Sprint(o) + hash := sha256.Sum256([]byte(desc)) + const hashLength = 6 + shortHash := hex.EncodeToString(hash[:])[:hashLength] + out = append(out, Permutation{ + Overload: o, + Desc: desc, + Hash: shortHash, + }) + + // Check for hash collisions + if existing, collision := hashes[shortHash]; collision { + return fmt.Errorf("hash '%v' collision between %v and %v\nIncrease hashLength in %v", + shortHash, existing, desc, fileutils.GoSourcePath()) + } + hashes[shortHash] = desc + return nil + } + for i, param := range overload.Parameters { + i, param := i, param // Capture iterator values for anonymous function + next := permutate // Permutation chaining + permutate = func() error { + permutations, err := state.permutateFQN(param.Type) + if err != nil { + return fmt.Errorf("while processing parameter %v: %w", i, err) + } + if len(permutations) == 0 { + return fmt.Errorf("parameter %v has no permutations", i) + } + for _, fqn := range permutations { + state.parameters[i] = fqn + if err := next(); err != nil { + return err + } + } + return nil + } + } + for _, t := range overload.TemplateParams { + next := permutate // Permutation chaining + switch t := t.(type) { + case *sem.TemplateTypeParam: + types := p.allTypes + if t.Type != nil { + var err error + types, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Type}) + if err != nil { + return nil, fmt.Errorf("while permutating open types: %w", err) + } + } + if len(types) == 0 { + return nil, fmt.Errorf("open type %v has no permutations", t.Name) + } + permutate = func() error { + for _, ty := range types { + state.closedTypes[t] = ty + if err := next(); err != nil { + return err + } + } + return nil + } + case *sem.TemplateEnumParam: + var permutations []sem.FullyQualifiedName + var err error + if t.Matcher != nil { + permutations, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Matcher}) + } else { + permutations, err = state.permutateFQN(sem.FullyQualifiedName{Target: t.Enum}) + } + if err != nil { + return nil, fmt.Errorf("while permutating open numbers: %w", err) + } + if len(permutations) == 0 { + return nil, fmt.Errorf("open type %v has no permutations", t.Name) + } + permutate = func() error { + for _, n := range permutations { + state.closedNumbers[t] = n + if err := next(); err != nil { + return err + } + } + return nil + } + case *sem.TemplateNumberParam: + // Currently all open numbers are used for vector / matrices + permutations := []int{2, 3, 4} + permutate = func() error { + for _, n := range permutations { + state.closedNumbers[t] = n + if err := next(); err != nil { + return err + } + } + return nil + } + } + } + + if err := permutate(); err != nil { + return nil, fmt.Errorf("%v %v %w\nState: %v", overload.Decl.Source, overload.Decl, err, state) + } + + return out, nil +} + +type permutationState struct { + *Permuter + closedTypes map[sem.TemplateParam]sem.FullyQualifiedName + closedNumbers map[sem.TemplateParam]interface{} + parameters map[int]sem.FullyQualifiedName +} + +func (s permutationState) String() string { + sb := &strings.Builder{} + sb.WriteString("Closed types:\n") + for ct, ty := range s.closedTypes { + fmt.Fprintf(sb, " %v: %v\n", ct.GetName(), ty) + } + sb.WriteString("Closed numbers:\n") + for cn, v := range s.closedNumbers { + fmt.Fprintf(sb, " %v: %v\n", cn.GetName(), v) + } + return sb.String() +} + +func (s *permutationState) permutateFQN(in sem.FullyQualifiedName) ([]sem.FullyQualifiedName, error) { + args := append([]interface{}{}, in.TemplateArguments...) + out := []sem.FullyQualifiedName{} + + // permutate appends a permutation to out. + // permutate may be chained to generate N-dimensional permutations. + var permutate func() error + + switch target := in.Target.(type) { + case *sem.Type: + permutate = func() error { + out = append(out, sem.FullyQualifiedName{Target: in.Target, TemplateArguments: args}) + args = append([]interface{}{}, in.TemplateArguments...) + return nil + } + case sem.TemplateParam: + if ty, ok := s.closedTypes[target]; ok { + permutate = func() error { + out = append(out, ty) + return nil + } + } else { + return nil, fmt.Errorf("'%v' was not found in closedTypes", target.GetName()) + } + case *sem.TypeMatcher: + permutate = func() error { + for _, ty := range target.Types { + out = append(out, sem.FullyQualifiedName{Target: ty}) + } + return nil + } + case *sem.EnumMatcher: + permutate = func() error { + for _, o := range target.Options { + if !o.IsInternal { + out = append(out, sem.FullyQualifiedName{Target: o}) + } + } + return nil + } + case *sem.Enum: + permutate = func() error { + for _, e := range target.Entries { + if !e.IsInternal { + out = append(out, sem.FullyQualifiedName{Target: e}) + } + } + return nil + } + default: + return nil, fmt.Errorf("unhandled target type: %T", in.Target) + } + + for i, arg := range in.TemplateArguments { + i := i // Capture iterator value for anonymous functions + next := permutate // Permutation chaining + switch arg := arg.(type) { + case sem.FullyQualifiedName: + switch target := arg.Target.(type) { + case sem.TemplateParam: + if ty, ok := s.closedTypes[target]; ok { + args[i] = ty + } else if num, ok := s.closedNumbers[target]; ok { + args[i] = num + } else { + return nil, fmt.Errorf("'%v' was not found in closedTypes or closedNumbers", target.GetName()) + } + default: + perms, err := s.permutateFQN(arg) + if err != nil { + return nil, fmt.Errorf("while processing template argument %v: %v", i, err) + } + if len(perms) == 0 { + return nil, fmt.Errorf("template argument %v has no permutations", i) + } + permutate = func() error { + for _, f := range perms { + args[i] = f + if err := next(); err != nil { + return err + } + } + return nil + } + } + default: + return nil, fmt.Errorf("permutateFQN() unhandled template argument type: %T", arg) + } + } + + if err := permutate(); err != nil { + return nil, fmt.Errorf("while processing fully qualified name '%v': %w", in.Target.GetName(), err) + } + + return out, nil +} + +func validate(fqn sem.FullyQualifiedName) bool { + switch fqn.Target.GetName() { + case "array": + elTy := fqn.TemplateArguments[0].(sem.FullyQualifiedName) + elTyName := elTy.Target.GetName() + switch { + case elTyName == "bool" || + strings.Contains(elTyName, "sampler"), + strings.Contains(elTyName, "texture"): + return false // Not storable + } + case "ptr": + storage := fqn.TemplateArguments[0].(sem.FullyQualifiedName).Target.(*sem.EnumEntry) + return storage.Name == "function" + } + + for _, arg := range fqn.TemplateArguments { + if argFQN, ok := arg.(sem.FullyQualifiedName); ok { + if !validate(argFQN) { + return false + } + } + } + + return true +} diff --git a/tools/src/cmd/intrinsic-gen/main.go b/tools/src/cmd/intrinsic-gen/main.go index b6577ee543..8be2966282 100644 --- a/tools/src/cmd/intrinsic-gen/main.go +++ b/tools/src/cmd/intrinsic-gen/main.go @@ -82,7 +82,8 @@ func run() error { // Recursively find all the template files in the /src directory files, err := glob.Scan(projectRoot, glob.MustParseConfig(`{ "paths": [{"include": [ - "src/**.tmpl" + "src/**.tmpl", + "test/**.tmpl" ]}] }`)) if err != nil {