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