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 } // anonymous
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			(createTestGroup(testCtx, "pipeline", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_PIPELINE));
70 #ifndef CTS_USES_VULKANSC
71 	de::MovePtr<tcu::TestCaseGroup> shaderObjectSpirvGroup	(createTestGroup(testCtx, "shader_object_spirv", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_SPIRV));
72 	de::MovePtr<tcu::TestCaseGroup> shaderObjectBinaryGroup	(createTestGroup(testCtx, "shader_object_binary", createChildren, COMPUTE_PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_BINARY));
73 #endif
74 
75 	de::MovePtr<tcu::TestCaseGroup> mainGroup(new tcu::TestCaseGroup(testCtx, name.c_str()));
76 	mainGroup->addChild(pipelineGroup.release());
77 #ifndef CTS_USES_VULKANSC
78 	mainGroup->addChild(shaderObjectSpirvGroup.release());
79 	mainGroup->addChild(shaderObjectBinaryGroup.release());
80 #endif
81 	return mainGroup.release();
82 }
83 
84 } // compute
85 } // vkt
86