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