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 #ifndef CTS_USES_VULKANSC
50 #include "vktDrawOutputLocationTests.hpp"
51 #include "vktDrawDepthBiasTests.hpp"
52 #include "vktDrawAhbTests.hpp"
53 #include "vktDrawMultiExtTests.hpp"
54 #endif // CTS_USES_VULKANSC
55
56 namespace vkt
57 {
58 namespace Draw
59 {
60
61 namespace
62 {
63
createChildren(tcu::TestContext & testCtx,tcu::TestCaseGroup * group,const SharedGroupParams groupParams)64 void createChildren (tcu::TestContext& testCtx, tcu::TestCaseGroup* group, const SharedGroupParams groupParams)
65 {
66 group->addChild(new ConcurrentDrawTests (testCtx, groupParams));
67 group->addChild(new SimpleDrawTests (testCtx, groupParams));
68 group->addChild(new DrawIndexedTests (testCtx, groupParams));
69 group->addChild(new IndirectDrawTests (testCtx, groupParams));
70 group->addChild(createBasicDrawTests (testCtx, groupParams));
71 group->addChild(new InstancedTests (testCtx, groupParams));
72 group->addChild(new ShaderDrawParametersTests (testCtx, groupParams));
73 group->addChild(createNegativeViewportHeightTests (testCtx, groupParams));
74 group->addChild(createZeroViewportHeightTests (testCtx, groupParams));
75 group->addChild(createInvertedDepthRangesTests (testCtx, groupParams));
76 group->addChild(createDifferingInterpolationTests (testCtx, groupParams));
77 group->addChild(createShaderLayerTests (testCtx, groupParams));
78 group->addChild(createShaderViewportIndexTests (testCtx, groupParams));
79 group->addChild(createScissorTests (testCtx, groupParams));
80 group->addChild(createMultipleInterpolationTests (testCtx, groupParams));
81 group->addChild(createMultisampleLinearInterpolationTests (testCtx, groupParams));
82 group->addChild(createDiscardRectanglesTests (testCtx, groupParams));
83 group->addChild(createExplicitVertexParameterTests (testCtx, groupParams));
84 group->addChild(createDepthClampTests (testCtx, groupParams));
85 group->addChild(new MultipleClearsWithinRenderPassTests (testCtx, groupParams));
86 // NOTE: all new draw tests should handle SharedGroupParams
87
88 #ifndef CTS_USES_VULKANSC
89 group->addChild(createDrawMultiExtTests (testCtx, groupParams));
90
91 if (!groupParams->useDynamicRendering)
92 {
93 // amber tests - no support for dynamic rendering
94 group->addChild(createDepthBiasTests (testCtx));
95 group->addChild(createOutputLocationTests (testCtx));
96 group->addChild(createShaderInvocationTests (testCtx));
97
98 // subpasses can't be translated to dynamic rendering
99 group->addChild(createAhbTests (testCtx));
100 }
101 #endif // CTS_USES_VULKANSC
102 }
103
104 } // anonymous
105
createTests(tcu::TestContext & testCtx)106 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
107 {
108 de::MovePtr<tcu::TestCaseGroup> mainGroup (new tcu::TestCaseGroup(testCtx, "draw", "Simple Draw tests"));
109 de::MovePtr<tcu::TestCaseGroup> renderpassGroup (new tcu::TestCaseGroup(testCtx, "renderpass", "Draw using renderpass object"));
110
111 createChildren(testCtx, renderpassGroup.get(), SharedGroupParams(
112 new GroupParams
113 {
114 false, // bool useDynamicRendering;
115 false, // bool useSecondaryCmdBuffer;
116 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
117 }));
118 mainGroup->addChild(renderpassGroup.release());
119
120 #ifndef CTS_USES_VULKANSC
121 de::MovePtr<tcu::TestCaseGroup> dynamicRenderingGroup (new tcu::TestCaseGroup(testCtx, "dynamic_rendering", "Draw using VK_KHR_dynamic_rendering"));
122 de::MovePtr<tcu::TestCaseGroup> drPrimaryCmdBuffGroup (new tcu::TestCaseGroup(testCtx, "primary_cmd_buff", ""));
123 de::MovePtr<tcu::TestCaseGroup> drPartialSecondaryCmdBuffGroup (new tcu::TestCaseGroup(testCtx, "partial_secondary_cmd_buff", "Secondary command buffer doesn't include begin/endRendering"));
124 de::MovePtr<tcu::TestCaseGroup> drCompleteSecondaryCmdBuffGroup (new tcu::TestCaseGroup(testCtx, "complete_secondary_cmd_buff", "Secondary command buffer contains completely dynamic renderpass"));
125
126 createChildren(testCtx, drPrimaryCmdBuffGroup.get(), SharedGroupParams(
127 new GroupParams
128 {
129 true, // bool useDynamicRendering;
130 false, // bool useSecondaryCmdBuffer;
131 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
132 }));
133 createChildren(testCtx, drPartialSecondaryCmdBuffGroup.get(), SharedGroupParams(
134 new GroupParams
135 {
136 true, // bool useDynamicRendering;
137 true, // bool useSecondaryCmdBuffer;
138 false, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
139 }));
140 createChildren(testCtx, drCompleteSecondaryCmdBuffGroup.get(), SharedGroupParams(
141 new GroupParams
142 {
143 true, // bool useDynamicRendering;
144 true, // bool useSecondaryCmdBuffer;
145 true, // bool secondaryCmdBufferCompletelyContainsDynamicRenderpass;
146 }));
147
148 dynamicRenderingGroup->addChild(drPrimaryCmdBuffGroup.release());
149 dynamicRenderingGroup->addChild(drPartialSecondaryCmdBuffGroup.release());
150 dynamicRenderingGroup->addChild(drCompleteSecondaryCmdBuffGroup.release());
151 mainGroup->addChild(dynamicRenderingGroup.release());
152 #endif // CTS_USES_VULKANSC
153
154 return mainGroup.release();
155 }
156
157 } // Draw
158 } // vkt
159