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