1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
5 * Copyright (c) 2016 The Khronos Group Inc.
6 * Copyright (c) 2023 LunarG, Inc.
7 * Copyright (c) 2023 Nintendo
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 *
21 *//*!
22 * \file
23 * \brief Compute Shader Tests
24 *//*--------------------------------------------------------------------*/
25
26 #include "vktComputeTests.hpp"
27 #include "vktComputeBasicComputeShaderTests.hpp"
28 #include "vktComputeCooperativeMatrixTests.hpp"
29 #include "vktComputeIndirectComputeDispatchTests.hpp"
30 #include "vktComputeShaderBuiltinVarTests.hpp"
31 #include "vktComputeZeroInitializeWorkgroupMemoryTests.hpp"
32 #ifndef CTS_USES_VULKANSC
33 #include "vktComputeWorkgroupMemoryExplicitLayoutTests.hpp"
34 #endif // CTS_USES_VULKANSC
35 #include "vktTestGroupUtil.hpp"
36 #include "vkComputePipelineConstructionUtil.hpp"
37
38 namespace vkt
39 {
40 namespace compute
41 {
42
43 using namespace vk;
44
45 namespace
46 {
47
createChildren(tcu::TestCaseGroup * computeTests,ComputePipelineConstructionType computePipelineConstructionType)48 void createChildren(tcu::TestCaseGroup *computeTests, ComputePipelineConstructionType computePipelineConstructionType)
49 {
50 tcu::TestContext &testCtx = computeTests->getTestContext();
51
52 computeTests->addChild(createBasicComputeShaderTests(testCtx, computePipelineConstructionType));
53 computeTests->addChild(createBasicDeviceGroupComputeShaderTests(testCtx, computePipelineConstructionType));
54 #ifndef CTS_USES_VULKANSC
55 computeTests->addChild(createCooperativeMatrixTests(testCtx, computePipelineConstructionType));
56 #endif
57 computeTests->addChild(createIndirectComputeDispatchTests(testCtx, computePipelineConstructionType));
58 computeTests->addChild(createComputeShaderBuiltinVarTests(testCtx, computePipelineConstructionType));
59 computeTests->addChild(createZeroInitializeWorkgroupMemoryTests(testCtx, computePipelineConstructionType));
60 #ifndef CTS_USES_VULKANSC
61 computeTests->addChild(createWorkgroupMemoryExplicitLayoutTests(testCtx, computePipelineConstructionType));
62 #endif // CTS_USES_VULKANSC
63 }
64
65 } // namespace
66
createTests(tcu::TestContext & testCtx,const std::string & name)67 tcu::TestCaseGroup *createTests(tcu::TestContext &testCtx, const std::string &name)
68 {
69 de::MovePtr<tcu::TestCaseGroup> pipelineGroup(
70 createTestGroup(testCtx, "pipeline", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_PIPELINE));
71 #ifndef CTS_USES_VULKANSC
72 de::MovePtr<tcu::TestCaseGroup> shaderObjectSpirvGroup(createTestGroup(
73 testCtx, "shader_object_spirv", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_SPIRV));
74 de::MovePtr<tcu::TestCaseGroup> shaderObjectBinaryGroup(createTestGroup(
75 testCtx, "shader_object_binary", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_BINARY));
76 #endif
77
78 de::MovePtr<tcu::TestCaseGroup> mainGroup(new tcu::TestCaseGroup(testCtx, name.c_str()));
79 mainGroup->addChild(pipelineGroup.release());
80 #ifndef CTS_USES_VULKANSC
81 mainGroup->addChild(shaderObjectSpirvGroup.release());
82 mainGroup->addChild(shaderObjectBinaryGroup.release());
83 #endif
84 return mainGroup.release();
85 }
86
87 } // namespace compute
88 } // namespace vkt
89