1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
5 * Copyright (c) 2015 The Khronos Group Inc.
6 * Copyright (c) 2015 Imagination Technologies Ltd.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 *//*!
21 * \file
22 * \brief Pipeline Tests
23 *//*--------------------------------------------------------------------*/
24
25 #include "vktPipelineTests.hpp"
26 #include "vktPipelineImageUtil.hpp"
27 #include "vktPipelineStencilTests.hpp"
28 #include "vktPipelineBlendTests.hpp"
29 #include "vktPipelineDepthTests.hpp"
30 #include "vktPipelineDescriptorLimitsTests.hpp"
31 #include "vktPipelineDynamicOffsetTests.hpp"
32 #include "vktPipelineEarlyDestroyTests.hpp"
33 #include "vktPipelineLogicOpTests.hpp"
34 #include "vktPipelineImageTests.hpp"
35 #include "vktPipelineInputAssemblyTests.hpp"
36 #include "vktPipelineInterfaceMatchingTests.hpp"
37 #include "vktPipelineSamplerTests.hpp"
38 #include "vktPipelineImageViewTests.hpp"
39 #include "vktPipelineImage2DViewOf3DTests.hpp"
40 #include "vktPipelinePushConstantTests.hpp"
41 #include "vktPipelinePushDescriptorTests.hpp"
42 #include "vktPipelineSpecConstantTests.hpp"
43 #include "vktPipelineMatchedAttachmentsTests.hpp"
44 #include "vktPipelineMultisampleTests.hpp"
45 #include "vktPipelineMultisampleInterpolationTests.hpp"
46 #include "vktPipelineMultisampleShaderBuiltInTests.hpp"
47 #include "vktPipelineVertexInputTests.hpp"
48 #include "vktPipelineTimestampTests.hpp"
49 #include "vktPipelineCacheTests.hpp"
50 #include "vktPipelineRenderToImageTests.hpp"
51 #include "vktPipelineFramebufferAttachmentTests.hpp"
52 #include "vktPipelineStencilExportTests.hpp"
53 #include "vktPipelineCreationFeedbackTests.hpp"
54 #include "vktPipelineDepthRangeUnrestrictedTests.hpp"
55 #include "vktPipelineExecutablePropertiesTests.hpp"
56 #include "vktPipelineMiscTests.hpp"
57 #include "vktPipelineMaxVaryingsTests.hpp"
58 #include "vktPipelineBlendOperationAdvancedTests.hpp"
59 #include "vktPipelineExtendedDynamicStateTests.hpp"
60 #include "vktPipelineDynamicControlPoints.hpp"
61 #ifndef CTS_USES_VULKANSC
62 #include "vktPipelineCreationCacheControlTests.hpp"
63 #include "vktPipelineBindPointTests.hpp"
64 #include "vktPipelineDerivativeTests.hpp"
65 #endif // CTS_USES_VULKANSC
66 #include "vktPipelineNoPositionTests.hpp"
67 #include "vktPipelineColorWriteEnableTests.hpp"
68 #include "vktPipelineLibraryTests.hpp"
69 #include "vktPipelineAttachmentFeedbackLoopLayoutTests.hpp"
70 #include "vktPipelineShaderModuleIdentifierTests.hpp"
71 #include "vktTestGroupUtil.hpp"
72
73 namespace vkt
74 {
75 namespace pipeline
76 {
77
78 using namespace vk;
79
80 namespace
81 {
82
createChildren(tcu::TestCaseGroup * group,PipelineConstructionType pipelineConstructionType)83 void createChildren (tcu::TestCaseGroup* group, PipelineConstructionType pipelineConstructionType)
84 {
85 tcu::TestContext& testCtx = group->getTestContext();
86
87 group->addChild(createDynamicControlPointTests (testCtx, pipelineConstructionType));
88 group->addChild(createStencilTests (testCtx, pipelineConstructionType));
89 group->addChild(createBlendTests (testCtx, pipelineConstructionType));
90 group->addChild(createDepthTests (testCtx, pipelineConstructionType));
91 group->addChild(createDescriptorLimitsTests (testCtx, pipelineConstructionType));
92 group->addChild(createDynamicOffsetTests (testCtx, pipelineConstructionType));
93 #ifndef CTS_USES_VULKANSC
94 group->addChild(createEarlyDestroyTests (testCtx, pipelineConstructionType));
95 #endif // CTS_USES_VULKANSC
96 group->addChild(createImageTests (testCtx, pipelineConstructionType));
97 group->addChild(createSamplerTests (testCtx, pipelineConstructionType));
98 group->addChild(createImageViewTests (testCtx, pipelineConstructionType));
99 #ifndef CTS_USES_VULKANSC
100 group->addChild(createImage2DViewOf3DTests (testCtx, pipelineConstructionType));
101 #endif // CTS_USES_VULKANSC
102 group->addChild(createLogicOpTests (testCtx, pipelineConstructionType));
103 #ifndef CTS_USES_VULKANSC
104 group->addChild(createPushConstantTests (testCtx, pipelineConstructionType));
105 group->addChild(createPushDescriptorTests (testCtx, pipelineConstructionType));
106 group->addChild(createMatchedAttachmentsTests (testCtx, pipelineConstructionType));
107 #endif // CTS_USES_VULKANSC
108 group->addChild(createSpecConstantTests (testCtx, pipelineConstructionType));
109 group->addChild(createMultisampleTests (testCtx, pipelineConstructionType, false));
110 group->addChild(createMultisampleTests (testCtx, pipelineConstructionType, true));
111 group->addChild(createMultisampleInterpolationTests (testCtx, pipelineConstructionType));
112 #ifndef CTS_USES_VULKANSC
113 group->addChild(createMultisampleShaderBuiltInTests (testCtx, pipelineConstructionType));
114 #endif // CTS_USES_VULKANSC
115 group->addChild(createTestGroup (testCtx, "vertex_input", "", createVertexInputTests, pipelineConstructionType));
116 group->addChild(createInputAssemblyTests (testCtx, pipelineConstructionType));
117 group->addChild(createInterfaceMatchingTests (testCtx, pipelineConstructionType));
118 group->addChild(createTimestampTests (testCtx, pipelineConstructionType));
119 #ifndef CTS_USES_VULKANSC
120 group->addChild(createCacheTests (testCtx, pipelineConstructionType));
121 group->addChild(createFramebufferAttachmentTests (testCtx, pipelineConstructionType));
122 #endif // CTS_USES_VULKANSC
123 group->addChild(createRenderToImageTests (testCtx, pipelineConstructionType));
124 group->addChild(createStencilExportTests (testCtx, pipelineConstructionType));
125 #ifndef CTS_USES_VULKANSC
126 group->addChild(createCreationFeedbackTests (testCtx, pipelineConstructionType));
127 group->addChild(createDepthRangeUnrestrictedTests (testCtx, pipelineConstructionType));
128 group->addChild(createExecutablePropertiesTests (testCtx, pipelineConstructionType));
129 #endif // CTS_USES_VULKANSC
130 group->addChild(createMaxVaryingsTests (testCtx, pipelineConstructionType));
131 group->addChild(createBlendOperationAdvancedTests (testCtx, pipelineConstructionType));
132 group->addChild(createExtendedDynamicStateTests (testCtx, pipelineConstructionType));
133 group->addChild(createNoPositionTests (testCtx, pipelineConstructionType));
134 #ifndef CTS_USES_VULKANSC
135 group->addChild(createBindPointTests (testCtx, pipelineConstructionType));
136 #endif // CTS_USES_VULKANSC
137 group->addChild(createColorWriteEnableTests (testCtx, pipelineConstructionType));
138 #ifndef CTS_USES_VULKANSC
139 group->addChild(createAttachmentFeedbackLoopLayoutTests (testCtx, pipelineConstructionType));
140 group->addChild(createShaderModuleIdentifierTests (testCtx, pipelineConstructionType));
141 #endif // CTS_USES_VULKANSC
142 group->addChild(createColorWriteEnable2Tests (testCtx, pipelineConstructionType));
143 group->addChild(createMiscTests (testCtx, pipelineConstructionType));
144
145 // NOTE: all new pipeline tests should use GraphicsPipelineWrapper for pipeline creation
146
147 if (pipelineConstructionType == PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC)
148 {
149 #ifndef CTS_USES_VULKANSC
150 // compute pipeline tests should not be repeated basing on pipelineConstructionType
151 group->addChild(createDerivativeTests (testCtx));
152
153 // dont repeat tests requiring timing execution of vkCreate*Pipelines
154 group->addChild(createCacheControlTests (testCtx));
155 #endif // CTS_USES_VULKANSC
156 }
157 #ifndef CTS_USES_VULKANSC
158 else if (pipelineConstructionType == PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY)
159 {
160 // execute pipeline library specific tests only once
161 group->addChild(createPipelineLibraryTests (testCtx));
162 }
163 #endif // CTS_USES_VULKANSC
164 }
165
166 } // anonymous
167
createTests(tcu::TestContext & testCtx)168 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
169 {
170 de::MovePtr<tcu::TestCaseGroup> monolithicGroup (createTestGroup(testCtx, "monolithic", "Monolithic pipeline tests", createChildren, PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC));
171 de::MovePtr<tcu::TestCaseGroup> pipelineLibraryGroup (createTestGroup(testCtx, "pipeline_library", "Graphics pipeline library tests", createChildren, PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY));
172 de::MovePtr<tcu::TestCaseGroup> fastLinkedLibraryGroup (createTestGroup(testCtx, "fast_linked_library", "Fast linked graphics pipeline library tests", createChildren, PIPELINE_CONSTRUCTION_TYPE_FAST_LINKED_LIBRARY));
173
174 de::MovePtr<tcu::TestCaseGroup> mainGroup(new tcu::TestCaseGroup(testCtx, "pipeline", "Pipeline Tests"));
175 mainGroup->addChild(monolithicGroup.release());
176 mainGroup->addChild(pipelineLibraryGroup.release());
177 mainGroup->addChild(fastLinkedLibraryGroup.release());
178 return mainGroup.release();
179 }
180
181 } // pipeline
182 } // vkt
183