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