1 /*------------------------------------------------------------------------
2 * Vulkan Conformance Tests
3 * ------------------------
4 *
5 * Copyright (c) 2015 The Khronos Group Inc.
6 * Copyright (c) 2015 Intel Corporation
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 Draw Tests
23 *//*--------------------------------------------------------------------*/
24
25 #include "vktDrawTests.hpp"
26
27 #include "vktDrawGroupParams.hpp"
28 #include "vktDrawSimpleTest.hpp"
29 #include "vktDrawConcurrentTests.hpp"
30 #include "vktDrawIndexedTest.hpp"
31 #include "vktDrawIndirectTest.hpp"
32 #include "vktDrawInstancedTests.hpp"
33 #include "vktTestGroupUtil.hpp"
34 #include "vktBasicDrawTests.hpp"
35 #include "vktDrawShaderDrawParametersTests.hpp"
36 #include "vktDrawShaderInvocationTests.hpp"
37 #include "vktDrawNegativeViewportHeightTests.hpp"
38 #include "vktDrawInvertedDepthRangesTests.hpp"
39 #include "vktDrawDifferingInterpolationTests.hpp"
40 #include "vktDrawShaderLayerTests.hpp"
41 #include "vktDrawShaderViewportIndexTests.hpp"
42 #include "vktDrawScissorTests.hpp"
43 #include "vktDrawMultipleInterpolationTests.hpp"
44 #include "vktDrawMultisampleLinearInterpolationTests.hpp"
45 #include "vktDrawDiscardRectanglesTests.hpp"
46 #include "vktDrawExplicitVertexParameterTests.hpp"
47 #include "vktDrawDepthClampTests.hpp"
48 #include "vktDrawMultipleClearsWithinRenderPass.hpp"
49 #include "vktDrawSampleAttributeTests.hpp"
50 #include "vktDrawVertexAttribDivisorTests.hpp"
51 #ifndef CTS_USES_VULKANSC
52 #include "vktDrawOutputLocationTests.hpp"
53 #include "vktDrawDepthBiasTests.hpp"
54 #include "vktDrawAhbTests.hpp"
55 #include "vktDrawAhbExternalFormatResolveTests.hpp"
56 #include "vktDrawMultiExtTests.hpp"
57 #endif // CTS_USES_VULKANSC
58 #include "vktDrawPointClampTests.hpp"
59
60 namespace vkt
61 {
62 namespace Draw
63 {
64
65 namespace
66 {
67
createChildren(tcu::TestContext & testCtx,tcu::TestCaseGroup * group,const SharedGroupParams groupParams)68 void createChildren(tcu::TestContext &testCtx, tcu::TestCaseGroup *group, const SharedGroupParams groupParams)
69 {
70 if (!groupParams->nestedSecondaryCmdBuffer)
71 {
72 group->addChild(new ConcurrentDrawTests(testCtx, groupParams));
73 group->addChild(new SimpleDrawTests(testCtx, groupParams));
74 group->addChild(new DrawIndexedTests(testCtx, groupParams));
75 group->addChild(new IndirectDrawTests(testCtx, groupParams));
76 }
77 group->addChild(createBasicDrawTests(testCtx, groupParams));
78 if (!groupParams->nestedSecondaryCmdBuffer)
79 {
80 group->addChild(new InstancedTests(testCtx, groupParams));
81 group->addChild(new ShaderDrawParametersTests(testCtx, groupParams));
82 group->addChild(createNegativeViewportHeightTests(testCtx, groupParams));
83 group->addChild(createZeroViewportHeightTests(testCtx, groupParams));
84 group->addChild(createOffScreenViewportTests(testCtx, groupParams));
85 group->addChild(createInvertedDepthRangesTests(testCtx, groupParams));
86 group->addChild(createDifferingInterpolationTests(testCtx, groupParams));
87 group->addChild(createShaderLayerTests(testCtx, groupParams));
88 group->addChild(createShaderViewportIndexTests(testCtx, groupParams));
89 group->addChild(createScissorTests(testCtx, groupParams));
90 group->addChild(createMultipleInterpolationTests(testCtx, groupParams));
91 group->addChild(createMultisampleLinearInterpolationTests(testCtx, groupParams));
92 group->addChild(createDiscardRectanglesTests(testCtx, groupParams));
93 group->addChild(createExplicitVertexParameterTests(testCtx, groupParams));
94 group->addChild(createDepthClampTests(testCtx, groupParams));
95 group->addChild(new MultipleClearsWithinRenderPassTests(testCtx, groupParams));
96 group->addChild(createSampleAttributeTests(testCtx, groupParams));
97 group->addChild(createVertexAttributeDivisorTests(testCtx, groupParams));
98 // NOTE: all new draw tests should handle SharedGroupParams
99
100 #ifndef CTS_USES_VULKANSC
101 group->addChild(createDrawMultiExtTests(testCtx, groupParams));
102
103 if (!groupParams->useDynamicRendering)
104 {
105 // amber tests - no support for dynamic rendering
106 group->addChild(createDepthBiasTests(testCtx));
107 group->addChild(createOutputLocationTests(testCtx));
108 group->addChild(createShaderInvocationTests(testCtx));
109
110 // subpasses can't be translated to dynamic rendering
111 group->addChild(createAhbTests(testCtx));
112 }
113
114 group->addChild(createAhbExternalFormatResolveTests(testCtx, groupParams));
115 #endif // CTS_USES_VULKANSC
116 }
117 }
118
119 } // namespace
120
createTests(tcu::TestContext & testCtx,const std::string & name)121 tcu::TestCaseGroup *createTests(tcu::TestContext &testCtx, const std::string &name)
122 {
123 de::MovePtr<tcu::TestCaseGroup> mainGroup(new tcu::TestCaseGroup(testCtx, name.c_str()));
124 // Draw using renderpass object
125 de::MovePtr<tcu::TestCaseGroup> renderpassGroup(new tcu::TestCaseGroup(testCtx, "renderpass"));
126
127 createChildren(testCtx, renderpassGroup.get(),
128 SharedGroupParams(new GroupParams{
129 false, // bool useDynamicRendering;
130 false, // bool useSecondaryCmdBuffer;
131 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
132 false, // bool nestedSecondaryCmdBuffer;
133 }));
134
135 renderpassGroup->addChild(createDrawPointClampTests(testCtx));
136
137 mainGroup->addChild(renderpassGroup.release());
138
139 #ifndef CTS_USES_VULKANSC
140 // Draw using VK_KHR_dynamic_rendering
141 de::MovePtr<tcu::TestCaseGroup> dynamicRenderingGroup(new tcu::TestCaseGroup(testCtx, "dynamic_rendering"));
142 de::MovePtr<tcu::TestCaseGroup> drPrimaryCmdBuffGroup(new tcu::TestCaseGroup(testCtx, "primary_cmd_buff"));
143 de::MovePtr<tcu::TestCaseGroup> drPartialSecondaryCmdBuffGroup(
144 new tcu::TestCaseGroup(testCtx, "partial_secondary_cmd_buff"));
145 de::MovePtr<tcu::TestCaseGroup> drCompleteSecondaryCmdBuffGroup(
146 new tcu::TestCaseGroup(testCtx, "complete_secondary_cmd_buff"));
147 de::MovePtr<tcu::TestCaseGroup> drNestedPartialSecondaryCmdBuffGroup(
148 new tcu::TestCaseGroup(testCtx, "nested_partial_secondary_cmd_buff"));
149 de::MovePtr<tcu::TestCaseGroup> drNestedCompleteSecondaryCmdBuffGroup(
150 new tcu::TestCaseGroup(testCtx, "nested_complete_secondary_cmd_buff"));
151
152 createChildren(testCtx, drPrimaryCmdBuffGroup.get(),
153 SharedGroupParams(new GroupParams{
154 true, // bool useDynamicRendering;
155 false, // bool useSecondaryCmdBuffer;
156 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
157 false, // bool nestedSecondaryCmdBuffer;
158 }));
159 createChildren(testCtx, drPartialSecondaryCmdBuffGroup.get(),
160 SharedGroupParams(new GroupParams{
161 true, // bool useDynamicRendering;
162 true, // bool useSecondaryCmdBuffer;
163 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
164 false, // bool nestedSecondaryCmdBuffer;
165 }));
166 createChildren(testCtx, drCompleteSecondaryCmdBuffGroup.get(),
167 SharedGroupParams(new GroupParams{
168 true, // bool useDynamicRendering;
169 true, // bool useSecondaryCmdBuffer;
170 true, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
171 false, // bool nestedSecondaryCmdBuffer;
172 }));
173 createChildren(testCtx, drNestedPartialSecondaryCmdBuffGroup.get(),
174 SharedGroupParams(new GroupParams{
175 true, // bool useDynamicRendering;
176 true, // bool useSecondaryCmdBuffer;
177 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
178 true, // bool nestedSecondaryCmdBuffer;
179 }));
180 createChildren(testCtx, drNestedCompleteSecondaryCmdBuffGroup.get(),
181 SharedGroupParams(new GroupParams{
182 true, // bool useDynamicRendering;
183 true, // bool useSecondaryCmdBuffer;
184 true, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
185 true, // bool nestedSecondaryCmdBuffer;
186 }));
187
188 dynamicRenderingGroup->addChild(drPrimaryCmdBuffGroup.release());
189 dynamicRenderingGroup->addChild(drPartialSecondaryCmdBuffGroup.release());
190 dynamicRenderingGroup->addChild(drCompleteSecondaryCmdBuffGroup.release());
191 dynamicRenderingGroup->addChild(drNestedPartialSecondaryCmdBuffGroup.release());
192 dynamicRenderingGroup->addChild(drNestedCompleteSecondaryCmdBuffGroup.release());
193 mainGroup->addChild(dynamicRenderingGroup.release());
194 #endif // CTS_USES_VULKANSC
195
196 return mainGroup.release();
197 }
198
199 } // namespace Draw
200 } // namespace vkt
201