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