Tests for VK_EXT_shader_module_identifier
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / pipeline / vktPipelineTests.cpp
1 /*------------------------------------------------------------------------
2  * Vulkan Conformance Tests
3  * ------------------------
4  *
5  * Copyright (c) 2015 The Khronos Group Inc.
6  * Copyright (c) 2015 Imagination Technologies Ltd.
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 Pipeline Tests
23  *//*--------------------------------------------------------------------*/
24
25 #include "vktPipelineTests.hpp"
26 #include "vktPipelineImageUtil.hpp"
27 #include "vktPipelineStencilTests.hpp"
28 #include "vktPipelineBlendTests.hpp"
29 #include "vktPipelineDepthTests.hpp"
30 #include "vktPipelineDynamicOffsetTests.hpp"
31 #include "vktPipelineEarlyDestroyTests.hpp"
32 #include "vktPipelineLogicOpTests.hpp"
33 #include "vktPipelineImageTests.hpp"
34 #include "vktPipelineInputAssemblyTests.hpp"
35 #include "vktPipelineInterfaceMatchingTests.hpp"
36 #include "vktPipelineSamplerTests.hpp"
37 #include "vktPipelineImageViewTests.hpp"
38 #include "vktPipelineImage2DViewOf3DTests.hpp"
39 #include "vktPipelinePushConstantTests.hpp"
40 #include "vktPipelinePushDescriptorTests.hpp"
41 #include "vktPipelineSpecConstantTests.hpp"
42 #include "vktPipelineMatchedAttachmentsTests.hpp"
43 #include "vktPipelineMultisampleTests.hpp"
44 #include "vktPipelineMultisampleInterpolationTests.hpp"
45 #include "vktPipelineMultisampleShaderBuiltInTests.hpp"
46 #include "vktPipelineVertexInputTests.hpp"
47 #include "vktPipelineTimestampTests.hpp"
48 #include "vktPipelineCacheTests.hpp"
49 #include "vktPipelineRenderToImageTests.hpp"
50 #include "vktPipelineFramebufferAttachmentTests.hpp"
51 #include "vktPipelineStencilExportTests.hpp"
52 #include "vktPipelineDerivativeTests.hpp"
53 #include "vktPipelineCreationFeedbackTests.hpp"
54 #include "vktPipelineDepthRangeUnrestrictedTests.hpp"
55 #include "vktPipelineExecutablePropertiesTests.hpp"
56 #include "vktPipelineMiscTests.hpp"
57 #include "vktPipelineMaxVaryingsTests.hpp"
58 #include "vktPipelineBlendOperationAdvancedTests.hpp"
59 #include "vktPipelineExtendedDynamicStateTests.hpp"
60 #include "vktPipelineCreationCacheControlTests.hpp"
61 #include "vktPipelineNoPositionTests.hpp"
62 #include "vktPipelineBindPointTests.hpp"
63 #include "vktPipelineColorWriteEnableTests.hpp"
64 #include "vktPipelineLibraryTests.hpp"
65 #include "vktPipelineShaderModuleIdentifierTests.hpp"
66 #include "vktTestGroupUtil.hpp"
67
68 namespace vkt
69 {
70 namespace pipeline
71 {
72
73 using namespace vk;
74
75 namespace
76 {
77
78 void createChildren (tcu::TestCaseGroup* group, PipelineConstructionType pipelineConstructionType)
79 {
80         tcu::TestContext& testCtx = group->getTestContext();
81
82         group->addChild(createStencilTests                                      (testCtx, pipelineConstructionType));
83         group->addChild(createBlendTests                                        (testCtx, pipelineConstructionType));
84         group->addChild(createDepthTests                                        (testCtx, pipelineConstructionType));
85         group->addChild(createDynamicOffsetTests                        (testCtx, pipelineConstructionType));
86         group->addChild(createEarlyDestroyTests                         (testCtx, pipelineConstructionType));
87         group->addChild(createImageTests                                        (testCtx, pipelineConstructionType));
88         group->addChild(createSamplerTests                                      (testCtx, pipelineConstructionType));
89         group->addChild(createImageViewTests                            (testCtx, pipelineConstructionType));
90         group->addChild(createImage2DViewOf3DTests                      (testCtx, pipelineConstructionType));
91         group->addChild(createLogicOpTests                                      (testCtx, pipelineConstructionType));
92         group->addChild(createPushConstantTests                         (testCtx, pipelineConstructionType));
93         group->addChild(createPushDescriptorTests                       (testCtx, pipelineConstructionType));
94         group->addChild(createSpecConstantTests                         (testCtx, pipelineConstructionType));
95         group->addChild(createMatchedAttachmentsTests           (testCtx, pipelineConstructionType));
96         group->addChild(createMultisampleTests                          (testCtx, pipelineConstructionType, false));
97         group->addChild(createMultisampleTests                          (testCtx, pipelineConstructionType, true));
98         group->addChild(createMultisampleInterpolationTests     (testCtx, pipelineConstructionType));
99         group->addChild(createMultisampleShaderBuiltInTests     (testCtx, pipelineConstructionType));
100         group->addChild(createTestGroup                                         (testCtx, "vertex_input", "", createVertexInputTests, pipelineConstructionType));
101         group->addChild(createInputAssemblyTests                        (testCtx, pipelineConstructionType));
102         group->addChild(createInterfaceMatchingTests            (testCtx, pipelineConstructionType));
103         group->addChild(createTimestampTests                            (testCtx, pipelineConstructionType));
104         group->addChild(createCacheTests                                        (testCtx, pipelineConstructionType));
105         group->addChild(createRenderToImageTests                        (testCtx, pipelineConstructionType));
106         group->addChild(createFramebufferAttachmentTests        (testCtx, pipelineConstructionType));
107         group->addChild(createStencilExportTests                        (testCtx, pipelineConstructionType));
108         group->addChild(createCreationFeedbackTests                     (testCtx, pipelineConstructionType));
109         group->addChild(createDepthRangeUnrestrictedTests       (testCtx, pipelineConstructionType));
110         group->addChild(createExecutablePropertiesTests         (testCtx, pipelineConstructionType));
111         group->addChild(createMaxVaryingsTests                          (testCtx, pipelineConstructionType));
112         group->addChild(createBlendOperationAdvancedTests       (testCtx, pipelineConstructionType));
113         group->addChild(createExtendedDynamicStateTests         (testCtx, pipelineConstructionType));
114         group->addChild(createNoPositionTests                           (testCtx, pipelineConstructionType));
115         group->addChild(createBindPointTests                            (testCtx, pipelineConstructionType));
116         group->addChild(createColorWriteEnableTests                     (testCtx, pipelineConstructionType));
117         group->addChild(createShaderModuleIdentifierTests       (testCtx, pipelineConstructionType));
118
119         // NOTE: all new pipeline tests should use GraphicsPipelineWrapper for pipeline creation
120
121         if (pipelineConstructionType == PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC)
122         {
123                 // there is no support for pipelineConstructionType in amber
124                 group->addChild(createMiscTests                                         (testCtx));
125
126                 // compute pipeline tests should not be repeated basing on pipelineConstructionType
127                 group->addChild(createDerivativeTests                           (testCtx));
128
129                 // dont repeat tests requiring timing execution of vkCreate*Pipelines
130                 group->addChild(createCacheControlTests                         (testCtx));
131         }
132         else if (pipelineConstructionType == PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY)
133         {
134                 // execute pipeline library specific tests only once
135                 group->addChild(createPipelineLibraryTests              (testCtx));
136         }
137 }
138
139 } // anonymous
140
141 tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx)
142 {
143         de::MovePtr<tcu::TestCaseGroup> monolithicGroup                 (createTestGroup(testCtx, "monolithic",                         "Monolithic pipeline tests",                                    createChildren, PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC));
144         de::MovePtr<tcu::TestCaseGroup> pipelineLibraryGroup    (createTestGroup(testCtx, "pipeline_library",           "Graphics pipeline library tests",                              createChildren, PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY));
145         de::MovePtr<tcu::TestCaseGroup> fastLinkedLibraryGroup  (createTestGroup(testCtx, "fast_linked_library",        "Fast linked graphics pipeline library tests",  createChildren, PIPELINE_CONSTRUCTION_TYPE_FAST_LINKED_LIBRARY));
146
147         de::MovePtr<tcu::TestCaseGroup> mainGroup(new tcu::TestCaseGroup(testCtx, "pipeline", "Pipeline Tests"));
148         mainGroup->addChild(monolithicGroup.release());
149         mainGroup->addChild(pipelineLibraryGroup.release());
150         mainGroup->addChild(fastLinkedLibraryGroup.release());
151         return mainGroup.release();
152 }
153
154 } // pipeline
155 } // vkt