Merge vk-gl-cts/vulkan-cts-1.0.2 into vk-gl-cts/master
[platform/upstream/VK-GL-CTS.git] / external / openglcts / modules / gl / gl4cTestPackages.cpp
1 /*-------------------------------------------------------------------------
2  * OpenGL Conformance Test Suite
3  * -----------------------------
4  *
5  * Copyright (c) 2016 Google Inc.
6  * Copyright (c) 2016 The Khronos Group Inc.
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 OpenGL 4.x Test Packages.
23  */ /*-------------------------------------------------------------------*/
24
25 #include "gl4cTestPackages.hpp"
26
27 #include "gl4cBufferStorageTests.hpp"
28 #include "gl4cClipControlTests.hpp"
29 #include "gl4cComputeShaderTests.hpp"
30 #include "gl4cConditionalRenderInvertedTests.hpp"
31 #include "gl4cContextFlushControlTests.hpp"
32 #include "gl4cCopyImageTests.hpp"
33 #include "gl4cDirectStateAccessTests.hpp"
34 #include "gl4cES31CompatibilityTests.hpp"
35 #include "gl4cEnhancedLayoutsTests.hpp"
36 #include "gl4cGPUShaderFP64Tests.hpp"
37 #include "gl4cGetTextureSubImageTests.hpp"
38 #include "gl4cIncompleteTextureAccessTests.hpp"
39 #include "gl4cIndirectParametersTests.hpp"
40 #include "gl4cKHRDebugTests.hpp"
41 #include "gl4cMapBufferAlignmentTests.hpp"
42 #include "gl4cMultiBindTests.hpp"
43 #include "gl4cParallelShaderCompileTests.hpp"
44 #include "gl4cPostDepthCoverageTests.hpp"
45 #include "gl4cProgramInterfaceQueryTests.hpp"
46 #include "gl4cRobustnessTests.hpp"
47 #include "gl4cShaderAtomicCounterOpsTests.hpp"
48 #include "gl4cShaderAtomicCountersTests.hpp"
49 #include "gl4cShaderImageLoadStoreTests.hpp"
50 #include "gl4cShaderImageSizeTests.hpp"
51 #include "gl4cShaderStorageBufferObjectTests.hpp"
52 #include "gl4cShaderSubroutineTests.hpp"
53 #include "gl4cShaderTextureImageSamplesTests.hpp"
54 #include "gl4cShadingLanguage420PackTests.hpp"
55 #include "gl4cSparseBufferTests.hpp"
56 #include "gl4cSparseTexture2Tests.hpp"
57 #include "gl4cSparseTextureClampTests.hpp"
58 #include "gl4cSparseTextureTests.hpp"
59 #include "gl4cStencilTexturingTests.hpp"
60 #include "gl4cSyncTests.hpp"
61 #include "gl4cTextureBarrierTests.hpp"
62 #include "gl4cTextureFilterMinmaxTests.hpp"
63 #include "gl4cTextureGatherTests.hpp"
64 #include "gl4cTextureViewTests.hpp"
65 #include "gl4cVertexAttrib64BitTest.hpp"
66 #include "gl4cVertexAttribBindingTests.hpp"
67 #include "glcBlendEquationAdvancedTests.hpp"
68 #include "glcInfoTests.hpp"
69 #include "glcRobustBufferAccessBehaviorTests.hpp"
70 #include "glcSampleVariablesTests.hpp"
71 #include "glcShaderIntegerMixTests.hpp"
72 #include "glcShaderLibrary.hpp"
73 #include "glcShaderMultisampleInterpolationTests.hpp"
74 #include "glcViewportArrayTests.hpp"
75
76 #include "../gles31/es31cArrayOfArraysTests.hpp"
77 #include "../gles31/es31cDrawIndirectTests.hpp"
78 #include "../gles31/es31cExplicitUniformLocationTest.hpp"
79 #include "../gles31/es31cLayoutBindingTests.hpp"
80 #include "../gles31/es31cSampleShadingTests.hpp"
81 #include "../gles31/es31cSeparateShaderObjsTests.hpp"
82 #include "../gles31/es31cShaderBitfieldOperationTests.hpp"
83 #include "../glesext/draw_elements_base_vertex/esextcDrawElementsBaseVertexTests.hpp"
84 #include "../glesext/geometry_shader/esextcGeometryShaderTests.hpp"
85 #include "../glesext/gpu_shader5/esextcGPUShader5Tests.hpp"
86 #include "../glesext/tessellation_shader/esextcTessellationShaderTests.hpp"
87 #include "../glesext/texture_border_clamp/esextcTextureBorderClampTests.hpp"
88 #include "../glesext/texture_buffer/esextcTextureBufferTests.hpp"
89 #include "../glesext/texture_cube_map_array/esextcTextureCubeMapArrayTests.hpp"
90
91 namespace gl4cts
92 {
93
94 // GL40TestPackage
95
96 GL40TestPackage::GL40TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
97                                                                  glu::ContextType renderContextType)
98         : GL33TestPackage(testCtx, packageName, packageName, renderContextType)
99 {
100         (void)description;
101 }
102
103 GL40TestPackage::~GL40TestPackage(void)
104 {
105 }
106
107 void GL40TestPackage::init(void)
108 {
109         // Call init() in parent - this creates context.
110         GL33TestPackage::init();
111
112         try
113         {
114                 glcts::ExtParameters extParams(glu::GLSL_VERSION_400, glcts::EXTENSIONTYPE_NONE);
115                 addChild(new glcts::DrawElementsBaseVertexTests(getContext(), extParams));
116                 addChild(new gl4cts::GPUShaderFP64Tests(getContext()));
117                 addChild(new gl4cts::TextureGatherTests(getContext()));
118                 addChild(new glcts::DrawIndirectTestsGL40(getContext()));
119                 addChild(new gl4cts::ClipControlTests(getContext(), gl4cts::ClipControlTests::API_GL_ARB_clip_control));
120                 addChild(new gl4cts::ShaderSubroutineTests(getContext()));
121                 addChild(
122                         new gl4cts::TextureBarrierTests(getContext(), gl4cts::TextureBarrierTests::API_GL_ARB_texture_barrier));
123         }
124         catch (...)
125         {
126                 // Destroy context.
127                 TestPackage::deinit();
128                 throw;
129         }
130 }
131
132 // GL41TestPackage
133
134 GL41TestPackage::GL41TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
135                                                                  glu::ContextType renderContextType)
136         : GL40TestPackage(testCtx, packageName, packageName, renderContextType)
137 {
138         (void)description;
139 }
140
141 GL41TestPackage::~GL41TestPackage(void)
142 {
143 }
144
145 void GL41TestPackage::init(void)
146 {
147         // Call init() in parent - this creates context.
148         GL40TestPackage::init();
149
150         try
151         {
152                 addChild(new gl4cts::VertexAttrib64BitTests(getContext()));
153                 glcts::ExtParameters extParams(glu::GLSL_VERSION_410, glcts::EXTENSIONTYPE_NONE);
154                 addChild(new glcts::ViewportArrayTests(getContext(), extParams));
155         }
156         catch (...)
157         {
158                 // Destroy context.
159                 TestPackage::deinit();
160                 throw;
161         }
162 }
163
164 // GL42TestPackage
165
166 GL42TestPackage::GL42TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
167                                                                  glu::ContextType renderContextType)
168         : GL41TestPackage(testCtx, packageName, packageName, renderContextType)
169 {
170         (void)description;
171 }
172
173 GL42TestPackage::~GL42TestPackage(void)
174 {
175 }
176
177 void GL42TestPackage::init(void)
178 {
179         // Call init() in parent - this creates context.
180         GL41TestPackage::init();
181
182         try
183         {
184                 addChild(new gl4cts::MapBufferAlignmentTests(getContext()));
185                 addChild(new gl4cts::ShaderAtomicCountersTests(getContext()));
186                 addChild(new gl4cts::ShaderImageLoadStoreTests(getContext()));
187                 addChild(new gl4cts::ShadingLanguage420PackTests(getContext()));
188                 addChild(new gl4cts::TextureViewTests(getContext()));
189         }
190         catch (...)
191         {
192                 // Destroy context.
193                 TestPackage::deinit();
194                 throw;
195         }
196 }
197
198 // GL43TestPackage
199
200 GL43TestPackage::GL43TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
201                                                                  glu::ContextType renderContextType)
202         : GL42TestPackage(testCtx, packageName, packageName, renderContextType)
203 {
204         (void)description;
205 }
206
207 GL43TestPackage::~GL43TestPackage(void)
208 {
209 }
210
211 void GL43TestPackage::init(void)
212 {
213         // Call init() in parent - this creates context.
214         GL42TestPackage::init();
215
216         try
217         {
218                 addChild(new glcts::ArrayOfArraysTestGroupGL(getContext()));
219                 addChild(new gl4cts::CopyImageTests(getContext()));
220                 addChild(new glcts::DrawIndirectTestsGL43(getContext()));
221                 addChild(new gl4cts::KHRDebugTests(getContext()));
222                 addChild(new gl4cts::ProgramInterfaceQueryTests(getContext()));
223                 addChild(new gl4cts::ComputeShaderTests(getContext()));
224                 addChild(new deqp::RobustBufferAccessBehaviorTests(getContext()));
225                 addChild(new gl4cts::ShaderStorageBufferObjectTests(getContext()));
226                 addChild(new gl4cts::VertexAttribBindingTests(getContext()));
227                 addChild(new gl4cts::ShaderImageSizeTests(getContext()));
228                 addChild(new glcts::ExplicitUniformLocationGLTests(getContext()));
229                 addChild(new glcts::BlendEquationAdvancedTests(getContext(), glu::GLSL_VERSION_430));
230                 addChild(new glcts::ShaderBitfieldOperationTests(getContext(), glu::GLSL_VERSION_430));
231                 addChild(new gl4cts::StencilTexturingTests(getContext()));
232                 addChild(new gl4cts::SparseBufferTests(getContext()));
233                 addChild(new gl4cts::SparseTextureTests(getContext()));
234                 addChild(new gl4cts::IndirectParametersTests(getContext()));
235         }
236         catch (...)
237         {
238                 // Destroy context.
239                 TestPackage::deinit();
240                 throw;
241         }
242 }
243
244 // GL44TestPackage
245
246 class GL44ShaderTests : public deqp::TestCaseGroup
247 {
248 public:
249         GL44ShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders44", "Shading Language Tests")
250         {
251         }
252
253         void init(void)
254         {
255                 addChild(
256                         new deqp::ShaderLibraryGroup(m_context, "preprocessor", "Preprocessor Tests", "gl44/preprocessor.test"));
257         }
258 };
259
260 GL44TestPackage::GL44TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
261                                                                  glu::ContextType renderContextType)
262         : GL43TestPackage(testCtx, packageName, packageName, renderContextType)
263 {
264         (void)description;
265 }
266
267 GL44TestPackage::~GL44TestPackage(void)
268 {
269 }
270
271 void GL44TestPackage::init(void)
272 {
273         // Call init() in parent - this creates context.
274         GL43TestPackage::init();
275
276         try
277         {
278                 addChild(new GL44ShaderTests(getContext()));
279                 addChild(new gl4cts::BufferStorageTests(getContext()));
280                 addChild(new gl4cts::EnhancedLayoutsTests(getContext()));
281                 addChild(new glcts::LayoutBindingTests(getContext(), glu::GLSL_VERSION_440));
282                 addChild(new gl4cts::MultiBindTests(getContext()));
283                 addChild(new glcts::SeparateShaderObjsTests(getContext(), glu::GLSL_VERSION_440));
284                 addChild(new glcts::SampleShadingTests(getContext(), glu::GLSL_VERSION_440));
285                 addChild(new deqp::SampleVariablesTests(getContext(), glu::GLSL_VERSION_440));
286                 addChild(new deqp::ShaderMultisampleInterpolationTests(getContext(), glu::GLSL_VERSION_440));
287                 addChild(new glcts::ShaderTextureImageSamplesTests(getContext()));
288
289                 glcts::ExtParameters extParams(glu::GLSL_VERSION_440, glcts::EXTENSIONTYPE_NONE);
290                 addChild(new glcts::GeometryShaderTests(getContext(), extParams));
291                 addChild(new glcts::GPUShader5Tests(getContext(), extParams));
292                 addChild(new glcts::TessellationShaderTests(getContext(), extParams));
293                 addChild(new glcts::TextureCubeMapArrayTests(getContext(), extParams));
294                 addChild(new glcts::TextureBorderClampTests(getContext(), extParams));
295                 addChild(new glcts::TextureBufferTests(getContext(), extParams));
296
297                 //addChild(new gl4cts::ContextFlushControl::Tests(getContext()));
298         }
299         catch (...)
300         {
301                 // Destroy context.
302                 TestPackage::deinit();
303                 throw;
304         }
305 }
306
307 // GL45TestPackage
308
309 class GL45ShaderTests : public deqp::TestCaseGroup
310 {
311 public:
312         GL45ShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders45", "Shading Language Tests")
313         {
314         }
315
316         void init(void)
317         {
318                 addChild(new deqp::ShaderIntegerMixTests(getContext(), glu::GLSL_VERSION_450));
319         }
320 };
321
322 GL45TestPackage::GL45TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
323                                                                  glu::ContextType renderContextType)
324         : GL44TestPackage(testCtx, packageName, packageName, renderContextType)
325 {
326         (void)description;
327 }
328
329 GL45TestPackage::~GL45TestPackage(void)
330 {
331 }
332
333 void GL45TestPackage::init(void)
334 {
335         // Call init() in parent - this creates context.
336         GL44TestPackage::init();
337
338         try
339         {
340                 addChild(new GL45ShaderTests(getContext()));
341                 addChild(new gl4cts::ClipControlTests(getContext(), gl4cts::ClipControlTests::API_GL_45core));
342                 addChild(new gl4cts::DirectStateAccess::Tests(getContext()));
343                 addChild(new gl4cts::GetTextureSubImage::Tests(getContext()));
344                 addChild(new gl4cts::RobustnessTests(getContext()));
345                 addChild(new gl4cts::TextureBarrierTests(getContext(), gl4cts::TextureBarrierTests::API_GL_45core));
346                 addChild(new gl4cts::ConditionalRenderInverted::Tests(getContext()));
347                 addChild(new gl4cts::Sync::Tests(getContext()));
348                 addChild(new gl4cts::IncompleteTextureAccess::Tests(getContext()));
349                 addChild(new gl4cts::ParallelShaderCompileTests(getContext()));
350                 addChild(new gl4cts::PostDepthCoverage(getContext()));
351                 addChild(new gl4cts::SparseTexture2Tests(getContext()));
352                 addChild(new gl4cts::SparseTextureClampTests(getContext()));
353                 addChild(new gl4cts::TextureFilterMinmax(getContext()));
354                 addChild(new gl4cts::ShaderAtomicCounterOps(getContext()));
355         }
356         catch (...)
357         {
358                 // Destroy context.
359                 TestPackage::deinit();
360                 throw;
361         }
362 }
363
364 } // gl4cts