porting changes for OpenGL Subgroup tests
[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 "gl4cGlSpirvTests.hpp"
39 #include "gl4cIncompleteTextureAccessTests.hpp"
40 #include "gl4cIndirectParametersTests.hpp"
41 #include "gl4cLimitsTests.hpp"
42 #include "gl4cMapBufferAlignmentTests.hpp"
43 #include "gl4cMultiBindTests.hpp"
44 #include "gl4cPostDepthCoverageTests.hpp"
45 #include "gl4cProgramInterfaceQueryTests.hpp"
46 #include "gl4cShaderAtomicCounterOpsTests.hpp"
47 #include "gl4cShaderAtomicCountersTests.hpp"
48 #include "gl4cShaderBallotTests.hpp"
49 #include "gl4cShaderDrawParametersTests.hpp"
50 #include "gl4cShaderImageLoadStoreTests.hpp"
51 #include "gl4cShaderImageSizeTests.hpp"
52 #include "gl4cShaderStorageBufferObjectTests.hpp"
53 #include "gl4cShaderSubroutineTests.hpp"
54 #include "gl4cShaderTextureImageSamplesTests.hpp"
55 #include "gl4cShaderViewportLayerArrayTests.hpp"
56 #include "gl4cShadingLanguage420PackTests.hpp"
57 #include "gl4cSparseBufferTests.hpp"
58 #include "gl4cSparseTexture2Tests.hpp"
59 #include "gl4cSparseTextureClampTests.hpp"
60 #include "gl4cSparseTextureTests.hpp"
61 #include "gl4cSpirvExtensionsTests.hpp"
62 #include "gl4cStencilTexturingTests.hpp"
63 #include "gl4cSyncTests.hpp"
64 #include "gl4cTextureBarrierTests.hpp"
65 #include "gl4cTextureFilterMinmaxTests.hpp"
66 #include "gl4cTextureGatherTests.hpp"
67 #include "gl4cTextureViewTests.hpp"
68 #include "gl4cVertexAttrib64BitTest.hpp"
69 #include "gl4cVertexAttribBindingTests.hpp"
70 #include "glcAggressiveShaderOptimizationsTests.hpp"
71 #include "glcBlendEquationAdvancedTests.hpp"
72 #include "glcExposedExtensionsTests.hpp"
73 #include "glcInfoTests.hpp"
74 #include "glcInternalformatTests.hpp"
75 #include "glcLayoutLocationTests.hpp"
76 #include "glcParallelShaderCompileTests.hpp"
77 #include "glcPolygonOffsetClampTests.hpp"
78 #include "glcSampleVariablesTests.hpp"
79 #include "glcSeparableProgramsTransformFeedbackTests.hpp"
80 #include "glcShaderConstExprTests.hpp"
81 #include "glcShaderGroupVoteTests.hpp"
82 #include "glcShaderIntegerMixTests.hpp"
83 #include "glcShaderLibrary.hpp"
84 #include "glcShaderMultisampleInterpolationTests.hpp"
85 #include "glcTextureFilterAnisotropicTests.hpp"
86 #include "glcViewportArrayTests.hpp"
87
88 #include "../common/subgroups/glcSubgroupsTests.hpp"
89
90 #include "../gles31/es31cArrayOfArraysTests.hpp"
91 #include "../gles31/es31cDrawIndirectTests.hpp"
92 #include "../gles31/es31cExplicitUniformLocationTest.hpp"
93 #include "../gles31/es31cLayoutBindingTests.hpp"
94 #include "../gles31/es31cSampleShadingTests.hpp"
95 #include "../gles31/es31cSeparateShaderObjsTests.hpp"
96 #include "../gles31/es31cShaderBitfieldOperationTests.hpp"
97 #include "../glesext/draw_elements_base_vertex/esextcDrawElementsBaseVertexTests.hpp"
98 #include "../glesext/geometry_shader/esextcGeometryShaderTests.hpp"
99 #include "../glesext/gpu_shader5/esextcGPUShader5Tests.hpp"
100 #include "../glesext/tessellation_shader/esextcTessellationShaderTests.hpp"
101 #include "../glesext/texture_border_clamp/esextcTextureBorderClampTests.hpp"
102 #include "../glesext/texture_buffer/esextcTextureBufferTests.hpp"
103 #include "../glesext/texture_cube_map_array/esextcTextureCubeMapArrayTests.hpp"
104
105 namespace gl4cts
106 {
107
108 // GL40TestPackage
109
110 GL40TestPackage::GL40TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
111                                                                  glu::ContextType renderContextType)
112         : GL33TestPackage(testCtx, packageName, packageName, renderContextType)
113 {
114         (void)description;
115 }
116
117 GL40TestPackage::~GL40TestPackage(void)
118 {
119 }
120
121 void GL40TestPackage::init(void)
122 {
123         // Call init() in parent - this creates context.
124         GL33TestPackage::init();
125
126         try
127         {
128                 glcts::ExtParameters extParams(glu::GLSL_VERSION_400, glcts::EXTENSIONTYPE_NONE);
129                 addChild(new glcts::DrawElementsBaseVertexTests(getContext(), extParams));
130                 addChild(new glcts::InternalformatTests(getContext()));
131                 addChild(new gl4cts::GPUShaderFP64Tests(getContext()));
132                 addChild(new gl4cts::TextureGatherTests(getContext()));
133                 addChild(new glcts::DrawIndirectTestsGL40(getContext()));
134                 addChild(new gl4cts::ClipControlTests(getContext(), gl4cts::ClipControlTests::API_GL_ARB_clip_control));
135                 addChild(new gl4cts::ShaderSubroutineTests(getContext()));
136                 addChild(
137                         new gl4cts::TextureBarrierTests(getContext(), gl4cts::TextureBarrierTests::API_GL_ARB_texture_barrier));
138                 addChild(new glcts::ExposedExtensionsTests(getContext()));
139         }
140         catch (...)
141         {
142                 // Destroy context.
143                 TestPackage::deinit();
144                 throw;
145         }
146 }
147
148 // GL41TestPackage
149
150 GL41TestPackage::GL41TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
151                                                                  glu::ContextType renderContextType)
152         : GL40TestPackage(testCtx, packageName, packageName, renderContextType)
153 {
154         (void)description;
155 }
156
157 GL41TestPackage::~GL41TestPackage(void)
158 {
159 }
160
161 void GL41TestPackage::init(void)
162 {
163         // Call init() in parent - this creates context.
164         GL40TestPackage::init();
165
166         try
167         {
168                 addChild(new gl4cts::VertexAttrib64BitTests(getContext()));
169                 glcts::ExtParameters extParams(glu::GLSL_VERSION_410, glcts::EXTENSIONTYPE_NONE);
170                 addChild(new glcts::ViewportArrayTests(getContext(), extParams));
171         }
172         catch (...)
173         {
174                 // Destroy context.
175                 TestPackage::deinit();
176                 throw;
177         }
178 }
179
180 // GL42TestPackage
181
182 class GL42ShaderTests : public deqp::TestCaseGroup
183 {
184 public:
185         GL42ShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders42", "Shading Language Tests")
186         {
187         }
188
189         void init(void)
190         {
191                 addChild(new deqp::ShaderLibraryGroup(m_context, "declarations", "Declaration Tests", "gl42/declarations.test"));
192         }
193 };
194
195 GL42TestPackage::GL42TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
196                                                                  glu::ContextType renderContextType)
197         : GL41TestPackage(testCtx, packageName, packageName, renderContextType)
198 {
199         (void)description;
200 }
201
202 GL42TestPackage::~GL42TestPackage(void)
203 {
204 }
205
206 void GL42TestPackage::init(void)
207 {
208         // Call init() in parent - this creates context.
209         GL41TestPackage::init();
210
211         try
212         {
213                 addChild(new gl4cts::MapBufferAlignmentTests(getContext()));
214                 addChild(new gl4cts::ShaderAtomicCountersTests(getContext()));
215                 addChild(new gl4cts::ShaderImageLoadStoreTests(getContext()));
216                 addChild(new gl4cts::ShadingLanguage420PackTests(getContext()));
217                 addChild(new gl4cts::TextureViewTests(getContext()));
218                 addChild(new GL42ShaderTests(getContext()));
219         }
220         catch (...)
221         {
222                 // Destroy context.
223                 TestPackage::deinit();
224                 throw;
225         }
226 }
227
228 // GL43TestPackage
229
230 GL43TestPackage::GL43TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
231                                                                  glu::ContextType renderContextType)
232         : GL42TestPackage(testCtx, packageName, packageName, renderContextType)
233 {
234         (void)description;
235 }
236
237 GL43TestPackage::~GL43TestPackage(void)
238 {
239 }
240
241 void GL43TestPackage::init(void)
242 {
243         // Call init() in parent - this creates context.
244         GL42TestPackage::init();
245
246         try
247         {
248                 addChild(new glcts::ArrayOfArraysTestGroupGL(getContext()));
249                 addChild(new gl4cts::CopyImageTests(getContext()));
250                 addChild(new glcts::DrawIndirectTestsGL43(getContext()));
251                 addChild(new gl4cts::ProgramInterfaceQueryTests(getContext()));
252                 addChild(new gl4cts::ComputeShaderTests(getContext()));
253                 addChild(new gl4cts::ShaderStorageBufferObjectTests(getContext()));
254                 addChild(new gl4cts::VertexAttribBindingTests(getContext()));
255                 addChild(new gl4cts::ShaderImageSizeTests(getContext()));
256                 addChild(new glcts::ExplicitUniformLocationGLTests(getContext()));
257                 addChild(new glcts::BlendEquationAdvancedTests(getContext(), glu::GLSL_VERSION_430));
258                 addChild(new glcts::ShaderBitfieldOperationTests(getContext(), glu::GLSL_VERSION_430));
259                 addChild(new gl4cts::StencilTexturingTests(getContext()));
260                 addChild(new gl4cts::SparseBufferTests(getContext()));
261                 addChild(new gl4cts::SparseTextureTests(getContext()));
262                 addChild(new gl4cts::IndirectParametersTests(getContext()));
263                 addChild(new gl4cts::ShaderBallotTests(getContext()));
264                 addChild(new glcts::ShaderConstExprTests(getContext()));
265                 addChild(new glcts::AggressiveShaderOptimizationsTests(getContext()));
266         }
267         catch (...)
268         {
269                 // Destroy context.
270                 TestPackage::deinit();
271                 throw;
272         }
273 }
274
275 // GL44TestPackage
276
277 class GL44ShaderTests : public deqp::TestCaseGroup
278 {
279 public:
280         GL44ShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders44", "Shading Language Tests")
281         {
282         }
283
284         void init(void)
285         {
286                 addChild(
287                         new deqp::ShaderLibraryGroup(m_context, "preprocessor", "Preprocessor Tests", "gl44/preprocessor.test"));
288         }
289 };
290
291 GL44TestPackage::GL44TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
292                                                                  glu::ContextType renderContextType)
293         : GL43TestPackage(testCtx, packageName, packageName, renderContextType)
294 {
295         (void)description;
296 }
297
298 GL44TestPackage::~GL44TestPackage(void)
299 {
300 }
301
302 void GL44TestPackage::init(void)
303 {
304         // Call init() in parent - this creates context.
305         GL43TestPackage::init();
306
307         try
308         {
309                 addChild(new GL44ShaderTests(getContext()));
310                 addChild(new gl4cts::BufferStorageTests(getContext()));
311                 addChild(new gl4cts::EnhancedLayoutsTests(getContext()));
312                 addChild(new glcts::LayoutBindingTests(getContext(), glu::GLSL_VERSION_440));
313                 addChild(new gl4cts::MultiBindTests(getContext()));
314                 addChild(new glcts::SeparateShaderObjsTests(getContext(), glu::GLSL_VERSION_440));
315                 addChild(new glcts::SampleShadingTests(getContext(), glu::GLSL_VERSION_440));
316                 addChild(new deqp::SampleVariablesTests(getContext(), glu::GLSL_VERSION_440));
317                 addChild(new deqp::ShaderMultisampleInterpolationTests(getContext(), glu::GLSL_VERSION_440));
318                 addChild(new glcts::ShaderTextureImageSamplesTests(getContext()));
319                 addChild(new glcts::TextureFilterAnisotropicTests(getContext()));
320
321                 glcts::ExtParameters extParams(glu::GLSL_VERSION_440, glcts::EXTENSIONTYPE_NONE);
322                 addChild(new glcts::GeometryShaderTests(getContext(), extParams));
323                 addChild(new glcts::GPUShader5Tests(getContext(), extParams));
324                 addChild(new glcts::TessellationShaderTests(getContext(), extParams));
325                 addChild(new glcts::TextureCubeMapArrayTests(getContext(), extParams));
326                 addChild(new glcts::TextureBorderClampTests(getContext(), extParams));
327                 addChild(new glcts::TextureBufferTests(getContext(), extParams));
328
329                 //addChild(new gl4cts::ContextFlushControl::Tests(getContext()));
330         }
331         catch (...)
332         {
333                 // Destroy context.
334                 TestPackage::deinit();
335                 throw;
336         }
337 }
338
339 // GL45TestPackage
340
341 class GL45ShaderTests : public deqp::TestCaseGroup
342 {
343 public:
344         GL45ShaderTests(deqp::Context& context) : TestCaseGroup(context, "shaders45", "Shading Language Tests")
345         {
346         }
347
348         void init(void)
349         {
350                 addChild(new deqp::ShaderIntegerMixTests(getContext(), glu::GLSL_VERSION_450));
351         }
352 };
353
354 GL45TestPackage::GL45TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
355                                                                  glu::ContextType renderContextType)
356         : GL44TestPackage(testCtx, packageName, packageName, renderContextType)
357 {
358         (void)description;
359 }
360
361 GL45TestPackage::~GL45TestPackage(void)
362 {
363 }
364
365 void GL45TestPackage::init(void)
366 {
367         // Call init() in parent - this creates context.
368         GL44TestPackage::init();
369
370         try
371         {
372                 addChild(new GL45ShaderTests(getContext()));
373                 addChild(new gl4cts::ClipControlTests(getContext(), gl4cts::ClipControlTests::API_GL_45core));
374                 addChild(new gl4cts::DirectStateAccess::Tests(getContext()));
375                 addChild(new gl4cts::GetTextureSubImage::Tests(getContext()));
376                 addChild(new gl4cts::TextureBarrierTests(getContext(), gl4cts::TextureBarrierTests::API_GL_45core));
377                 addChild(new gl4cts::ConditionalRenderInverted::Tests(getContext()));
378                 addChild(new gl4cts::Sync::Tests(getContext()));
379                 addChild(new gl4cts::IncompleteTextureAccess::Tests(getContext()));
380                 addChild(new glcts::ParallelShaderCompileTests(getContext()));
381                 addChild(new gl4cts::PostDepthCoverage(getContext()));
382                 addChild(new gl4cts::SparseTexture2Tests(getContext()));
383                 addChild(new gl4cts::SparseTextureClampTests(getContext()));
384                 addChild(new gl4cts::TextureFilterMinmax(getContext()));
385                 addChild(new gl4cts::ShaderAtomicCounterOps(getContext()));
386                 addChild(new gl4cts::ShaderDrawParametersTests(getContext()));
387                 addChild(new gl4cts::ShaderViewportLayerArray(getContext()));
388                 addChild(new gl4cts::LimitsTests(getContext()));
389                 addChild(new glcts::ShaderGroupVote(getContext()));
390                 addChild(new glcts::PolygonOffsetClamp(getContext()));
391                 addChild(new glcts::SeparableProgramsTransformFeedbackTests(getContext()));
392                 addChild(new glcts::LayoutLocationTests(getContext()));
393                 addChild(new gl4cts::SpirvExtensionsTests(getContext()));
394                 addChild(new gl4cts::GlSpirvTests(getContext()));
395                 addChild(new glc::subgroups::GlSubgroupTests(getContext()));
396         }
397         catch (...)
398         {
399                 // Destroy context.
400                 TestPackage::deinit();
401                 throw;
402         }
403 }
404
405 GL46TestPackage::GL46TestPackage(tcu::TestContext& testCtx, const char* packageName, const char* description,
406                                                                  glu::ContextType renderContextType)
407         : GL45TestPackage(testCtx, packageName, packageName, renderContextType)
408 {
409         (void)description;
410 }
411
412 GL46TestPackage::~GL46TestPackage(void)
413 {
414 }
415
416 void GL46TestPackage::init(void)
417 {
418         // Call init() in parent - this creates context.
419         GL45TestPackage::init();
420 }
421
422 } // gl4cts