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