67e9340a70ee4b14e031b8a0f97d584f8df96cd1
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / draw / vktDrawTests.cpp
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 "vktDrawSimpleTest.hpp"
28 #include "vktDrawConcurrentTests.hpp"
29 #include "vktDrawIndexedTest.hpp"
30 #include "vktDrawIndirectTest.hpp"
31 #include "vktDrawInstancedTests.hpp"
32 #include "vktTestGroupUtil.hpp"
33 #include "vktBasicDrawTests.hpp"
34 #include "vktDrawShaderDrawParametersTests.hpp"
35 #include "vktDrawNegativeViewportHeightTests.hpp"
36 #include "vktDrawInvertedDepthRangesTests.hpp"
37 #include "vktDrawDifferingInterpolationTests.hpp"
38 #include "vktDrawShaderLayerTests.hpp"
39 #include "vktDrawShaderViewportIndexTests.hpp"
40 #include "vktDrawScissorTests.hpp"
41 #include "vktDrawMultipleInterpolationTests.hpp"
42 #include "vktDrawDiscardRectanglesTests.hpp"
43 #include "vktDrawExplicitVertexParameterTests.hpp"
44 #include "vktDrawOutputLocationTests.hpp"
45 #include "vktDrawDepthClampTests.hpp"
46 #include "vktDrawAhbTests.hpp"
47 #include "vktDrawMultipleClearsWithinRenderPass.hpp"
48 #include "vktDrawMultiExtTests.hpp"
49
50 namespace vkt
51 {
52 namespace Draw
53 {
54
55 namespace
56 {
57
58 tcu::TestCaseGroup* createTestsInternal (tcu::TestContext& testCtx, bool useDynamicRendering)
59 {
60         const char*             groupName[]                     { "draw",                               "draw_with_dynamic_rendering" };
61         const char*             groupDescription[]      { "Simple Draw tests",  "Simple Draw tests using VK_KHR_dynamic_rendering" };
62
63         de::MovePtr<tcu::TestCaseGroup> group(new tcu::TestCaseGroup(testCtx, groupName[useDynamicRendering], groupDescription[useDynamicRendering]));
64
65         group->addChild(new ConcurrentDrawTests                                 (testCtx, useDynamicRendering));
66         group->addChild(new SimpleDrawTests                                             (testCtx, useDynamicRendering));
67         group->addChild(new DrawIndexedTests                                    (testCtx, useDynamicRendering));
68         group->addChild(new IndirectDrawTests                                   (testCtx, useDynamicRendering));
69         group->addChild(createBasicDrawTests                                    (testCtx, useDynamicRendering));
70         group->addChild(new InstancedTests                                              (testCtx, useDynamicRendering));
71         group->addChild(new ShaderDrawParametersTests                   (testCtx, useDynamicRendering));
72         group->addChild(createNegativeViewportHeightTests               (testCtx, useDynamicRendering));
73         group->addChild(createZeroViewportHeightTests                   (testCtx, useDynamicRendering));
74         group->addChild(createInvertedDepthRangesTests                  (testCtx, useDynamicRendering));
75         group->addChild(createDifferingInterpolationTests               (testCtx, useDynamicRendering));
76         group->addChild(createShaderLayerTests                                  (testCtx, useDynamicRendering));
77         group->addChild(createShaderViewportIndexTests                  (testCtx, useDynamicRendering));
78         group->addChild(createScissorTests                                              (testCtx, useDynamicRendering));
79         group->addChild(createMultipleInterpolationTests                (testCtx, useDynamicRendering));
80         group->addChild(createDiscardRectanglesTests                    (testCtx, useDynamicRendering));
81         group->addChild(createExplicitVertexParameterTests              (testCtx, useDynamicRendering));
82         group->addChild(createDepthClampTests                                   (testCtx, useDynamicRendering));
83         group->addChild(new MultipleClearsWithinRenderPassTests (testCtx, useDynamicRendering));
84         group->addChild(createDrawMultiExtTests                                 (testCtx, useDynamicRendering));
85
86         if (!useDynamicRendering)
87         {
88                 // amber tests - no support for dynamic rendering
89                 group->addChild(createOutputLocationTests                       (testCtx));
90
91                 // subpasses can't be translated to dynamic rendering
92                 group->addChild(createAhbTests                                          (testCtx));
93         }
94
95         return group.release();
96 }
97
98 } // anonymous
99
100 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
101 {
102         return createTestsInternal(testCtx, false);
103 }
104
105 tcu::TestCaseGroup* createDynamicRenderingTests (tcu::TestContext& testCtx)
106 {
107         return createTestsInternal(testCtx, true);
108 }
109
110 } // Draw
111 } // vkt