1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
4 *
5 * Copyright 2014 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 *//*!
20 * \file
21 * \brief Functional Tests.
22 *//*--------------------------------------------------------------------*/
23
24 #include "es31fFunctionalTests.hpp"
25
26 #include "glsShaderLibrary.hpp"
27 #include "es31fBasicComputeShaderTests.hpp"
28 #include "es31fComputeShaderBuiltinVarTests.hpp"
29 #include "es31fDrawTests.hpp"
30 #include "es31fShaderSharedVarTests.hpp"
31 #include "es31fAtomicCounterTests.hpp"
32 #include "es31fShaderAtomicOpTests.hpp"
33 #include "es31fShaderImageLoadStoreTests.hpp"
34 #include "es31fTessellationTests.hpp"
35 #include "es31fSSBOLayoutTests.hpp"
36 #include "es31fSSBOArrayLengthTests.hpp"
37 #include "es31fShaderCommonFunctionTests.hpp"
38 #include "es31fShaderPackingFunctionTests.hpp"
39 #include "es31fShaderIntegerFunctionTests.hpp"
40 #include "es31fStencilTexturingTests.hpp"
41 #include "es31fShaderTextureSizeTests.hpp"
42 #include "es31fShaderStateQueryTests.hpp"
43 #include "es31fLayoutBindingTests.hpp"
44 #include "es31fTextureLevelStateQueryTests.hpp"
45 #include "es31fIntegerStateQueryTests.hpp"
46 #include "es31fInternalFormatQueryTests.hpp"
47 #include "es31fTextureFilteringTests.hpp"
48 #include "es31fTextureFormatTests.hpp"
49 #include "es31fTextureSpecificationTests.hpp"
50 #include "es31fTextureMultisampleTests.hpp"
51 #include "es31fMultisampleTests.hpp"
52 #include "es31fSynchronizationTests.hpp"
53 #include "es31fGeometryShaderTests.hpp"
54 #include "es31fSampleShadingTests.hpp"
55 #include "es31fSampleVariableTests.hpp"
56 #include "es31fIndirectComputeDispatchTests.hpp"
57 #include "es31fVertexAttributeBindingTests.hpp"
58 #include "es31fVertexAttributeBindingStateQueryTests.hpp"
59 #include "es31fShaderMultisampleInterpolationTests.hpp"
60 #include "es31fShaderMultisampleInterpolationStateQueryTests.hpp"
61 #include "es31fProgramUniformTests.hpp"
62 #include "es31fOpaqueTypeIndexingTests.hpp"
63 #include "es31fAdvancedBlendTests.hpp"
64 #include "es31fSeparateShaderTests.hpp"
65 #include "es31fUniformLocationTests.hpp"
66 #include "es31fBuiltinPrecisionTests.hpp"
67 #include "es31fTessellationGeometryInteractionTests.hpp"
68 #include "es31fUniformBlockTests.hpp"
69 #include "es31fDebugTests.hpp"
70 #include "es31fFboColorbufferTests.hpp"
71 #include "es31fFboNoAttachmentTests.hpp"
72 #include "es31fProgramInterfaceQueryTests.hpp"
73 #include "es31fTextureGatherTests.hpp"
74 #include "es31fTextureFormatTests.hpp"
75 #include "es31fTextureBufferTests.hpp"
76 #include "es31fShaderBuiltinConstantTests.hpp"
77 #include "es31fShaderHelperInvocationTests.hpp"
78
79 namespace deqp
80 {
81 namespace gles31
82 {
83 namespace Functional
84 {
85
86 class ShaderLibraryTest : public TestCaseGroup
87 {
88 public:
ShaderLibraryTest(Context & context,const char * name,const char * description)89 ShaderLibraryTest (Context& context, const char* name, const char* description)
90 : TestCaseGroup (context, name, description)
91 , m_filename (name + std::string(".test"))
92 {
93 }
94
ShaderLibraryTest(Context & context,const char * filename,const char * name,const char * description)95 ShaderLibraryTest (Context& context, const char* filename, const char* name, const char* description)
96 : TestCaseGroup (context, name, description)
97 , m_filename (filename)
98 {
99 }
100
init(void)101 void init (void)
102 {
103 gls::ShaderLibrary shaderLibrary(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo());
104 std::string fileName = "shaders/" + m_filename;
105 std::vector<tcu::TestNode*> children = shaderLibrary.loadShaderFile(fileName.c_str());
106
107 for (int i = 0; i < (int)children.size(); i++)
108 addChild(children[i]);
109 }
110
111 private:
112 const std::string m_filename;
113 };
114
115 class ShaderBuiltinVarTests : public TestCaseGroup
116 {
117 public:
ShaderBuiltinVarTests(Context & context)118 ShaderBuiltinVarTests (Context& context)
119 : TestCaseGroup(context, "builtin_var", "Shader Built-in Variable Tests")
120 {
121 }
122
init(void)123 void init (void)
124 {
125 addChild(new ComputeShaderBuiltinVarTests(m_context));
126 }
127 };
128
129 class ShaderBuiltinFunctionTests : public TestCaseGroup
130 {
131 public:
ShaderBuiltinFunctionTests(Context & context)132 ShaderBuiltinFunctionTests (Context& context)
133 : TestCaseGroup(context, "builtin_functions", "Built-in Function Tests")
134 {
135 }
136
init(void)137 void init (void)
138 {
139 addChild(new ShaderCommonFunctionTests (m_context));
140 addChild(new ShaderPackingFunctionTests (m_context));
141 addChild(new ShaderIntegerFunctionTests (m_context));
142 addChild(new ShaderTextureSizeTests (m_context));
143 addChild(createBuiltinPrecisionTests (m_context));
144 }
145 };
146
147 class ShaderLinkageTests : public TestCaseGroup
148 {
149 public:
ShaderLinkageTests(Context & context)150 ShaderLinkageTests (Context& context)
151 : TestCaseGroup(context, "linkage", "Linkage Tests")
152 {
153 }
154
init(void)155 void init (void)
156 {
157 addChild(new ShaderLibraryTest(m_context, "linkage_geometry.test", "geometry", "Geometry shader"));
158 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation.test", "tessellation", "Tessellation shader"));
159 addChild(new ShaderLibraryTest(m_context, "linkage_tessellation_geometry.test", "tessellation_geometry", "Tessellation and geometry shader"));
160 addChild(new ShaderLibraryTest(m_context, "linkage_shader_storage_block.test", "shader_storage_block", "Shader storage blocks"));
161 addChild(new ShaderLibraryTest(m_context, "linkage_io_block.test", "io_block", "Shader io blocks"));
162 }
163 };
164
165 class ShaderTests : public TestCaseGroup
166 {
167 public:
ShaderTests(Context & context)168 ShaderTests (Context& context)
169 : TestCaseGroup(context, "shaders", "Shading Language Tests")
170 {
171 }
172
init(void)173 void init (void)
174 {
175 addChild(new ShaderBuiltinVarTests (m_context));
176 addChild(new ShaderBuiltinFunctionTests (m_context));
177 addChild(new SampleVariableTests (m_context));
178 addChild(new ShaderMultisampleInterpolationTests(m_context));
179 addChild(new OpaqueTypeIndexingTests (m_context));
180 addChild(new ShaderLibraryTest (m_context, "functions", "Function Tests"));
181 addChild(new ShaderLibraryTest (m_context, "arrays_of_arrays", "Arrays of Arrays Tests"));
182 addChild(new ShaderLinkageTests (m_context));
183 addChild(new ShaderBuiltinConstantTests (m_context));
184 addChild(new ShaderHelperInvocationTests (m_context));
185 addChild(new ShaderLibraryTest (m_context, "implicit_conversions", "GL_EXT_shader_implicit_conversions Tests"));
186 }
187 };
188
189 class ComputeTests : public TestCaseGroup
190 {
191 public:
ComputeTests(Context & context)192 ComputeTests (Context& context)
193 : TestCaseGroup(context, "compute", "Compute Shader Tests")
194 {
195 }
196
init(void)197 void init (void)
198 {
199 addChild(new BasicComputeShaderTests (m_context));
200 addChild(new ShaderSharedVarTests (m_context));
201 addChild(new IndirectComputeDispatchTests (m_context));
202 }
203 };
204
205 class SSBOTests : public TestCaseGroup
206 {
207 public:
SSBOTests(Context & context)208 SSBOTests (Context& context)
209 : TestCaseGroup(context, "ssbo", "Shader Storage Buffer Object Tests")
210 {
211 }
212
init(void)213 void init (void)
214 {
215 addChild(new SSBOLayoutTests (m_context));
216 addChild(new ShaderAtomicOpTests (m_context, "atomic", ATOMIC_OPERAND_BUFFER_VARIABLE));
217 addChild(new SSBOArrayLengthTests (m_context));
218 }
219 };
220
221 class TextureTests : public TestCaseGroup
222 {
223 public:
TextureTests(Context & context)224 TextureTests (Context& context)
225 : TestCaseGroup(context, "texture", "Texture tests")
226 {
227 }
228
init(void)229 void init (void)
230 {
231 addChild(new TextureFilteringTests (m_context));
232 addChild(new TextureFormatTests (m_context));
233 addChild(new TextureSpecificationTests (m_context));
234 addChild(new TextureMultisampleTests (m_context));
235 addChild(new TextureGatherTests (m_context));
236 addChild(createTextureBufferTests (m_context));
237 }
238 };
239
240 class StateQueryTests : public TestCaseGroup
241 {
242 public:
StateQueryTests(Context & context)243 StateQueryTests (Context& context)
244 : TestCaseGroup(context, "state_query", "State query tests")
245 {
246 }
247
init(void)248 void init (void)
249 {
250 addChild(new IntegerStateQueryTests (m_context));
251 addChild(new TextureLevelStateQueryTests (m_context));
252 addChild(new ShaderStateQueryTests (m_context));
253 addChild(new InternalFormatQueryTests (m_context));
254 addChild(new VertexAttributeBindingStateQueryTests (m_context));
255 addChild(new ShaderMultisampleInterpolationStateQueryTests (m_context));
256 }
257 };
258
259 class FboTests : public TestCaseGroup
260 {
261 public:
FboTests(Context & context)262 FboTests (Context& context)
263 : TestCaseGroup(context, "fbo", "Framebuffer Object Tests")
264 {
265 }
266
init(void)267 void init (void)
268 {
269 addChild(new FboColorTests (m_context));
270 addChild(createFboNoAttachmentTests (m_context));
271 addChild(createFboNoAttachmentCompletenessTests (m_context));
272 }
273 };
274
FunctionalTests(Context & context)275 FunctionalTests::FunctionalTests (Context& context)
276 : TestCaseGroup(context, "functional", "Functionality Tests")
277 {
278 }
279
~FunctionalTests(void)280 FunctionalTests::~FunctionalTests (void)
281 {
282 }
283
init(void)284 void FunctionalTests::init (void)
285 {
286 addChild(new ShaderTests (m_context));
287 addChild(new ComputeTests (m_context));
288 addChild(new DrawTests (m_context));
289 addChild(new TessellationTests (m_context));
290 addChild(new SSBOTests (m_context));
291 addChild(new UniformBlockTests (m_context));
292 addChild(new ShaderImageLoadStoreTests (m_context));
293 addChild(new AtomicCounterTests (m_context));
294 addChild(new StencilTexturingTests (m_context));
295 addChild(new TextureTests (m_context));
296 addChild(new StateQueryTests (m_context));
297 addChild(new MultisampleTests (m_context));
298 addChild(new SynchronizationTests (m_context));
299 addChild(new GeometryShaderTests (m_context));
300 addChild(new SampleShadingTests (m_context));
301 addChild(new VertexAttributeBindingTests (m_context));
302 addChild(new ProgramUniformTests (m_context));
303 addChild(new AdvancedBlendTests (m_context));
304 addChild(createSeparateShaderTests (m_context));
305 addChild(new UniformLocationTests (m_context));
306 addChild(new TessellationGeometryInteractionTests (m_context));
307 addChild(new DebugTests (m_context));
308 addChild(new FboTests (m_context));
309 addChild(new ProgramInterfaceQueryTests (m_context));
310 addChild(new LayoutBindingTests (m_context));
311
312 }
313
314 } // Functional
315 } // gles31
316 } // deqp
317