• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2015 The Khronos Group Inc.
6  * Copyright (c) 2015 Intel Corporation
7  * Copyright (c) 2023 LunarG, Inc.
8  * Copyright (c) 2023 Nintendo
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  *//*!
23  * \file
24  * \brief Dynamic State Tests
25  *//*--------------------------------------------------------------------*/
26 
27 #include "vktDynamicStateTests.hpp"
28 
29 #include "vktDynamicStateVPTests.hpp"
30 #include "vktDynamicStateRSTests.hpp"
31 #include "vktDynamicStateCBTests.hpp"
32 #include "vktDynamicStateDSTests.hpp"
33 #include "vktDynamicStateGeneralTests.hpp"
34 #include "vktDynamicStateComputeTests.hpp"
35 #include "vktDynamicStateInheritanceTests.hpp"
36 #include "vktDynamicStateClearTests.hpp"
37 #include "vktDynamicStateDiscardTests.hpp"
38 #include "vktDynamicStateLineWidthTests.hpp"
39 #include "vktTestGroupUtil.hpp"
40 
41 namespace vkt
42 {
43 namespace DynamicState
44 {
45 
46 namespace
47 {
48 
createChildren(tcu::TestCaseGroup * group,vk::PipelineConstructionType pipelineConstructionType)49 void createChildren (tcu::TestCaseGroup* group, vk::PipelineConstructionType pipelineConstructionType)
50 {
51 	tcu::TestContext&	testCtx		= group->getTestContext();
52 
53 	group->addChild(new DynamicStateVPTests				(testCtx, pipelineConstructionType));
54 	group->addChild(new DynamicStateRSTests				(testCtx, pipelineConstructionType));
55 	group->addChild(new DynamicStateCBTests				(testCtx, pipelineConstructionType));
56 	group->addChild(new DynamicStateDSTests				(testCtx, pipelineConstructionType));
57 	group->addChild(new DynamicStateGeneralTests		(testCtx, pipelineConstructionType));
58 	group->addChild(new DynamicStateInheritanceTests	(testCtx, pipelineConstructionType));
59 	group->addChild(new DynamicStateClearTests			(testCtx, pipelineConstructionType));
60 	group->addChild(new DynamicStateDiscardTests		(testCtx, pipelineConstructionType));
61 	group->addChild(new DynamicStateLWTests				(testCtx, pipelineConstructionType));
62 
63 	if (pipelineConstructionType == vk::PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC || pipelineConstructionType == vk::PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_UNLINKED_SPIRV)
64 		group->addChild(createDynamicStateComputeTests	(testCtx, pipelineConstructionType));
65 }
66 
cleanupGroup(tcu::TestCaseGroup *)67 void cleanupGroup(tcu::TestCaseGroup*)
68 {
69 	// Destroy singleton objects.
70 	cleanupDevice();
71 }
72 
initDynamicStateTestGroup(tcu::TestCaseGroup * mainGroup)73 void initDynamicStateTestGroup (tcu::TestCaseGroup* mainGroup)
74 {
75 	auto& testCtx = mainGroup->getTestContext();
76 
77 	de::MovePtr<tcu::TestCaseGroup> monolithicGroup					(createTestGroup(testCtx, "monolithic",								createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC));
78 	de::MovePtr<tcu::TestCaseGroup> pipelineLibraryGroup			(createTestGroup(testCtx, "pipeline_library",						createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY));
79 	de::MovePtr<tcu::TestCaseGroup> fastLinkedLibraryGroup			(createTestGroup(testCtx, "fast_linked_library",					createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_FAST_LINKED_LIBRARY));
80 	de::MovePtr<tcu::TestCaseGroup> shaderObjectUnlinkedSpirvGroup	(createTestGroup(testCtx, "shader_object_unlinked_spirv",			createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_UNLINKED_SPIRV));
81 	de::MovePtr<tcu::TestCaseGroup> shaderObjectUnlinkedBinaryGroup	(createTestGroup(testCtx, "shader_object_unlinked_binary",			createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_UNLINKED_BINARY));
82 	de::MovePtr<tcu::TestCaseGroup> shaderObjectLinkedSpirvGroup	(createTestGroup(testCtx, "shader_object_linked_spirv",				createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_LINKED_SPIRV));
83 	de::MovePtr<tcu::TestCaseGroup> shaderObjectLinkedBinaryGroup	(createTestGroup(testCtx, "shader_object_linked_binary",			createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_SHADER_OBJECT_LINKED_BINARY));
84 
85 	mainGroup->addChild(monolithicGroup.release());
86 	mainGroup->addChild(pipelineLibraryGroup.release());
87 	mainGroup->addChild(fastLinkedLibraryGroup.release());
88 	mainGroup->addChild(shaderObjectUnlinkedSpirvGroup.release());
89 	mainGroup->addChild(shaderObjectUnlinkedBinaryGroup.release());
90 	mainGroup->addChild(shaderObjectLinkedSpirvGroup.release());
91 	mainGroup->addChild(shaderObjectLinkedBinaryGroup.release());
92 }
93 
94 } // anonymous
95 
createTests(tcu::TestContext & testCtx,const std::string & name)96 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx, const std::string& name)
97 {
98 	// Dynamic State Tests
99 	return createTestGroup(testCtx, name.c_str(), initDynamicStateTestGroup, cleanupGroup);
100 }
101 
102 } // DynamicState
103 } // vkt
104