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 Integer state query tests
22 *//*--------------------------------------------------------------------*/
23
24 #include "es31fIntegerStateQueryTests.hpp"
25 #include "tcuTestLog.hpp"
26 #include "gluRenderContext.hpp"
27 #include "gluCallLogWrapper.hpp"
28 #include "gluContextInfo.hpp"
29 #include "gluObjectWrapper.hpp"
30 #include "gluShaderProgram.hpp"
31 #include "gluStrUtil.hpp"
32 #include "glwFunctions.hpp"
33 #include "glwEnums.hpp"
34 #include "glsStateQueryUtil.hpp"
35 #include "deRandom.hpp"
36 #include "deStringUtil.hpp"
37
38 namespace deqp
39 {
40 namespace gles31
41 {
42 namespace Functional
43 {
44 namespace
45 {
46
47 using namespace gls::StateQueryUtil;
48
49 const int MAX_FRAG_ATOMIC_COUNTER_BUFFERS_GLES32 = 1;
50 const int MAX_FRAG_ATOMIC_COUNTERS_GLES32 = 8;
51 const int MAX_FRAG_SHADER_STORAGE_BLOCKS_GLES32 = 4;
52
getVerifierSuffix(QueryType type)53 static const char* getVerifierSuffix (QueryType type)
54 {
55 switch (type)
56 {
57 case QUERY_BOOLEAN: return "getboolean";
58 case QUERY_INTEGER: return "getinteger";
59 case QUERY_INTEGER64: return "getinteger64";
60 case QUERY_FLOAT: return "getfloat";
61 default:
62 DE_ASSERT(DE_FALSE);
63 return DE_NULL;
64 }
65 }
66
67 class MaxSamplesCase : public TestCase
68 {
69 public:
70 MaxSamplesCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType);
71 private:
72 IterateResult iterate (void);
73
74 const glw::GLenum m_target;
75 const int m_minValue;
76 const QueryType m_verifierType;
77 };
78
MaxSamplesCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,QueryType verifierType)79 MaxSamplesCase::MaxSamplesCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType)
80 : TestCase (context, name, desc)
81 , m_target (target)
82 , m_minValue (minValue)
83 , m_verifierType (verifierType)
84 {
85 }
86
iterate(void)87 MaxSamplesCase::IterateResult MaxSamplesCase::iterate (void)
88 {
89 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
90 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
91
92 gl.enableLogging(true);
93 verifyStateIntegerMin(result, gl, m_target, m_minValue, m_verifierType);
94
95 result.setTestContextResult(m_testCtx);
96 return STOP;
97 }
98
99 class TexBindingCase : public TestCase
100 {
101 public:
102 TexBindingCase (Context& context, const char* name, const char* desc, glw::GLenum texTarget, glw::GLenum bindTarget, QueryType verifierType);
103 private:
104 void init (void);
105 IterateResult iterate (void);
106
107 const glw::GLenum m_texTarget;
108 const glw::GLenum m_bindTarget;
109 const QueryType m_verifierType;
110 };
111
TexBindingCase(Context & context,const char * name,const char * desc,glw::GLenum texTarget,glw::GLenum bindTarget,QueryType verifierType)112 TexBindingCase::TexBindingCase (Context& context, const char* name, const char* desc, glw::GLenum texTarget, glw::GLenum bindTarget, QueryType verifierType)
113 : TestCase (context, name, desc)
114 , m_texTarget (texTarget)
115 , m_bindTarget (bindTarget)
116 , m_verifierType (verifierType)
117 {
118 }
119
init(void)120 void TexBindingCase::init (void)
121 {
122 auto ctxType = m_context.getRenderContext().getType();
123 if (contextSupports(ctxType, glu::ApiType::es(3, 2)) ||
124 contextSupports(ctxType, glu::ApiType::core(4, 5)))
125 return;
126
127 if (m_texTarget == GL_TEXTURE_2D_MULTISAMPLE_ARRAY && !m_context.getContextInfo().isExtensionSupported("GL_OES_texture_storage_multisample_2d_array"))
128 throw tcu::NotSupportedError("Test requires OES_texture_storage_multisample_2d_array extension");
129 if (m_texTarget == GL_TEXTURE_CUBE_MAP_ARRAY && !m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_cube_map_array"))
130 throw tcu::NotSupportedError("Test requires GL_EXT_texture_cube_map_array extension");
131 if (m_texTarget == GL_TEXTURE_BUFFER && !m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_buffer"))
132 throw tcu::NotSupportedError("Test requires GL_EXT_texture_buffer extension");
133 }
134
iterate(void)135 TexBindingCase::IterateResult TexBindingCase::iterate (void)
136 {
137 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
138 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
139
140 gl.enableLogging(true);
141
142 // initial
143 {
144 const tcu::ScopedLogSection section(m_testCtx.getLog(), "initial", "Initial value");
145
146 verifyStateInteger(result, gl, m_bindTarget, 0, m_verifierType);
147 }
148
149 // bind
150 {
151 const tcu::ScopedLogSection section(m_testCtx.getLog(), "bind", "After bind");
152
153 glw::GLuint texture;
154
155 gl.glGenTextures(1, &texture);
156 gl.glBindTexture(m_texTarget, texture);
157 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "bind texture");
158
159 verifyStateInteger(result, gl, m_bindTarget, texture, m_verifierType);
160
161 gl.glDeleteTextures(1, &texture);
162 }
163
164 // after delete
165 {
166 const tcu::ScopedLogSection section(m_testCtx.getLog(), "bind", "After delete");
167
168 verifyStateInteger(result, gl, m_bindTarget, 0, m_verifierType);
169 }
170
171 result.setTestContextResult(m_testCtx);
172 return STOP;
173 }
174
175 class MinimumValueCase : public TestCase
176 {
177 public:
178 MinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType);
179 MinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType, glu::ApiType minVersion);
180 private:
181 IterateResult iterate (void);
182
183 const glw::GLenum m_target;
184 const int m_minValue;
185 const QueryType m_verifierType;
186 const glu::ApiType m_minimumVersion;
187 };
188
MinimumValueCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,QueryType verifierType)189 MinimumValueCase::MinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType)
190 : TestCase (context, name, desc)
191 , m_target (target)
192 , m_minValue (minValue)
193 , m_verifierType (verifierType)
194 , m_minimumVersion (glu::ApiType::es(3, 1))
195 {
196 }
197
MinimumValueCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,QueryType verifierType,glu::ApiType minVersion)198 MinimumValueCase::MinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType, glu::ApiType minVersion)
199 : TestCase (context, name, desc)
200 , m_target (target)
201 , m_minValue (minValue)
202 , m_verifierType (verifierType)
203 , m_minimumVersion (minVersion)
204 {
205 }
206
iterate(void)207 MinimumValueCase::IterateResult MinimumValueCase::iterate (void)
208 {
209 if (!contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
210 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(m_context.getRenderContext().getType(), m_minimumVersion), "Test not supported in this context version.");
211
212 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
213 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
214
215 // \note: In GL ES 3.2, the following targets have different limits as in 3.1
216 const int value = contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2))
217 ? (m_target == GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS ? MAX_FRAG_ATOMIC_COUNTER_BUFFERS_GLES32 // 1
218 : m_target == GL_MAX_FRAGMENT_ATOMIC_COUNTERS ? MAX_FRAG_ATOMIC_COUNTERS_GLES32 // 8
219 : m_target == GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS ? MAX_FRAG_SHADER_STORAGE_BLOCKS_GLES32 // 4
220 : m_minValue)
221 : m_minValue;
222
223 gl.enableLogging(true);
224 verifyStateIntegerMin(result, gl, m_target, value, m_verifierType);
225
226 result.setTestContextResult(m_testCtx);
227 return STOP;
228 }
229
230 class AlignmentCase : public TestCase
231 {
232 public:
233 AlignmentCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType);
234 AlignmentCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType, glu::ApiType minVersion);
235 private:
236 IterateResult iterate (void);
237
238 const glw::GLenum m_target;
239 const int m_minValue;
240 const QueryType m_verifierType;
241 const glu::ApiType m_minimumVersion;
242 };
243
AlignmentCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,QueryType verifierType)244 AlignmentCase::AlignmentCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType)
245 : TestCase (context, name, desc)
246 , m_target (target)
247 , m_minValue (minValue)
248 , m_verifierType (verifierType)
249 , m_minimumVersion (glu::ApiType::es(3, 1))
250 {
251 }
252
AlignmentCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,QueryType verifierType,glu::ApiType minVersion)253 AlignmentCase::AlignmentCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, QueryType verifierType, glu::ApiType minVersion)
254 : TestCase (context, name, desc)
255 , m_target (target)
256 , m_minValue (minValue)
257 , m_verifierType (verifierType)
258 , m_minimumVersion (minVersion)
259 {
260 }
261
iterate(void)262 AlignmentCase::IterateResult AlignmentCase::iterate (void)
263 {
264 if (!contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
265 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(m_context.getRenderContext().getType(), m_minimumVersion), "Test not supported in this context.");
266
267 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
268 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
269
270 gl.enableLogging(true);
271 verifyStateIntegerMax(result, gl, m_target, m_minValue, m_verifierType);
272
273 result.setTestContextResult(m_testCtx);
274 return STOP;
275 }
276
277 class BufferBindingCase : public TestCase
278 {
279 public:
280 BufferBindingCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bindingPoint, QueryType verifierType);
281 private:
282 IterateResult iterate (void);
283
284 const glw::GLenum m_queryTarget;
285 const glw::GLenum m_bindingPoint;
286 const QueryType m_verifierType;
287 };
288
BufferBindingCase(Context & context,const char * name,const char * desc,glw::GLenum queryTarget,glw::GLenum bindingPoint,QueryType verifierType)289 BufferBindingCase::BufferBindingCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bindingPoint, QueryType verifierType)
290 : TestCase (context, name, desc)
291 , m_queryTarget (queryTarget)
292 , m_bindingPoint (bindingPoint)
293 , m_verifierType (verifierType)
294 {
295 }
296
iterate(void)297 BufferBindingCase::IterateResult BufferBindingCase::iterate (void)
298 {
299 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
300 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
301
302 gl.enableLogging(true);
303
304 {
305 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
306
307 verifyStateInteger(result, gl, m_queryTarget, 0, m_verifierType);
308 }
309
310 {
311 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterBinding", "After binding");
312 glu::Buffer buf (m_context.getRenderContext());
313
314 gl.glBindBuffer(m_bindingPoint, *buf);
315 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "setup");
316
317 verifyStateInteger(result, gl, m_queryTarget, *buf, m_verifierType);
318 }
319
320 {
321 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterDelete", "After deleting");
322 glw::GLuint buf = 0;
323
324 gl.glGenBuffers(1, &buf);
325 gl.glBindBuffer(m_bindingPoint, buf);
326 gl.glDeleteBuffers(1, &buf);
327 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "setup");
328
329 verifyStateInteger(result, gl, m_queryTarget, 0, m_verifierType);
330 }
331
332 result.setTestContextResult(m_testCtx);
333 return STOP;
334 }
335
336 class ProgramPipelineBindingCase : public TestCase
337 {
338 public:
339 ProgramPipelineBindingCase (Context& context, const char* name, const char* desc, QueryType verifierType);
340 private:
341 IterateResult iterate (void);
342
343 const QueryType m_verifierType;
344 };
345
ProgramPipelineBindingCase(Context & context,const char * name,const char * desc,QueryType verifierType)346 ProgramPipelineBindingCase::ProgramPipelineBindingCase (Context& context, const char* name, const char* desc, QueryType verifierType)
347 : TestCase (context, name, desc)
348 , m_verifierType (verifierType)
349 {
350 }
351
iterate(void)352 ProgramPipelineBindingCase::IterateResult ProgramPipelineBindingCase::iterate (void)
353 {
354 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
355 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
356
357 gl.enableLogging(true);
358
359 {
360 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
361
362 verifyStateInteger(result, gl, GL_PROGRAM_PIPELINE_BINDING, 0, m_verifierType);
363 }
364
365 {
366 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterBinding", "After binding");
367 glu::ProgramPipeline pipeline (m_context.getRenderContext());
368
369 gl.glBindProgramPipeline(pipeline.getPipeline());
370 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "setup");
371
372 verifyStateInteger(result, gl, GL_PROGRAM_PIPELINE_BINDING, pipeline.getPipeline(), m_verifierType);
373 }
374
375 {
376 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterDelete", "After deleting");
377 glw::GLuint pipeline = 0;
378
379 gl.glGenProgramPipelines(1, &pipeline);
380 gl.glBindProgramPipeline(pipeline);
381 gl.glDeleteProgramPipelines(1, &pipeline);
382 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "setup");
383
384 verifyStateInteger(result, gl, GL_PROGRAM_PIPELINE_BINDING, 0, m_verifierType);
385 }
386
387 result.setTestContextResult(m_testCtx);
388 return STOP;
389 }
390
391 class FramebufferMinimumValueCase : public TestCase
392 {
393 public:
394 FramebufferMinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, glw::GLenum tiedTo, QueryType verifierType);
395 private:
396 IterateResult iterate (void);
397
398 const glw::GLenum m_target;
399 const glw::GLenum m_tiedTo;
400 const int m_minValue;
401 const QueryType m_verifierType;
402 };
403
FramebufferMinimumValueCase(Context & context,const char * name,const char * desc,glw::GLenum target,int minValue,glw::GLenum tiedTo,QueryType verifierType)404 FramebufferMinimumValueCase::FramebufferMinimumValueCase (Context& context, const char* name, const char* desc, glw::GLenum target, int minValue, glw::GLenum tiedTo, QueryType verifierType)
405 : TestCase (context, name, desc)
406 , m_target (target)
407 , m_tiedTo (tiedTo)
408 , m_minValue (minValue)
409 , m_verifierType (verifierType)
410 {
411 }
412
iterate(void)413 FramebufferMinimumValueCase::IterateResult FramebufferMinimumValueCase::iterate (void)
414 {
415 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
416 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
417
418 gl.enableLogging(true);
419
420 {
421 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Minimum", "Specified minimum is " + de::toString(m_minValue));
422
423 verifyStateIntegerMin(result, gl, m_target, m_minValue, m_verifierType);
424 }
425 {
426 const tcu::ScopedLogSection section (m_testCtx.getLog(), "Ties", "The limit is tied to the value of " + de::toString(glu::getGettableStateStr(m_tiedTo)));
427 StateQueryMemoryWriteGuard<glw::GLint> tiedToValue;
428
429 gl.glGetIntegerv(m_tiedTo, &tiedToValue);
430 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGetIntegerv");
431
432 if (tiedToValue.verifyValidity(result))
433 verifyStateIntegerMin(result, gl, m_target, tiedToValue, m_verifierType);
434 }
435
436 result.setTestContextResult(m_testCtx);
437 return STOP;
438 }
439
440 class LegacyVectorLimitCase : public TestCase
441 {
442 public:
443 LegacyVectorLimitCase (Context& context, const char* name, const char* desc, glw::GLenum legacyTarget, glw::GLenum componentTarget, QueryType verifierType);
444 private:
445 IterateResult iterate (void);
446
447 const glw::GLenum m_legacyTarget;
448 const glw::GLenum m_componentTarget;
449 const QueryType m_verifierType;
450 };
451
LegacyVectorLimitCase(Context & context,const char * name,const char * desc,glw::GLenum legacyTarget,glw::GLenum componentTarget,QueryType verifierType)452 LegacyVectorLimitCase::LegacyVectorLimitCase (Context& context, const char* name, const char* desc, glw::GLenum legacyTarget, glw::GLenum componentTarget, QueryType verifierType)
453 : TestCase (context, name, desc)
454 , m_legacyTarget (legacyTarget)
455 , m_componentTarget (componentTarget)
456 , m_verifierType (verifierType)
457 {
458 }
459
iterate(void)460 LegacyVectorLimitCase::IterateResult LegacyVectorLimitCase::iterate (void)
461 {
462 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
463 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
464
465 gl.enableLogging(true);
466
467 {
468 const tcu::ScopedLogSection section(m_testCtx.getLog(), "TiedTo", de::toString(glu::getGettableStateStr(m_legacyTarget)) +
469 " is " +
470 de::toString(glu::getGettableStateStr(m_componentTarget)) +
471 " divided by four");
472
473 StateQueryMemoryWriteGuard<glw::GLint> value;
474 gl.glGetIntegerv(m_componentTarget, &value);
475 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGetIntegerv");
476
477 if (value.verifyValidity(result))
478 verifyStateInteger(result, gl, m_legacyTarget, ((int)value) / 4, m_verifierType);
479 }
480
481 result.setTestContextResult(m_testCtx);
482 return STOP;
483 }
484
485 class CombinedUniformComponentsCase : public TestCase
486 {
487 public:
488 CombinedUniformComponentsCase (Context& context, const char* name, const char* desc, glw::GLenum target, QueryType verifierType);
489 CombinedUniformComponentsCase (Context& context, const char* name, const char* desc, glw::GLenum target, QueryType verifierType, glu::ApiType minVersion);
490 private:
491 IterateResult iterate (void);
492 const glw::GLenum m_target;
493 const QueryType m_verifierType;
494 const glu::ApiType m_minimumVersion;
495 };
496
CombinedUniformComponentsCase(Context & context,const char * name,const char * desc,glw::GLenum target,QueryType verifierType)497 CombinedUniformComponentsCase::CombinedUniformComponentsCase (Context& context, const char* name, const char* desc, glw::GLenum target, QueryType verifierType)
498 : TestCase (context, name, desc)
499 , m_target (target)
500 , m_verifierType (verifierType)
501 , m_minimumVersion (glu::ApiType::es(3, 1))
502 {
503 }
504
CombinedUniformComponentsCase(Context & context,const char * name,const char * desc,glw::GLenum target,QueryType verifierType,glu::ApiType minVersion)505 CombinedUniformComponentsCase::CombinedUniformComponentsCase (Context& context, const char* name, const char* desc, glw::GLenum target, QueryType verifierType, glu::ApiType minVersion)
506 : TestCase (context, name, desc)
507 , m_target (target)
508 , m_verifierType (verifierType)
509 , m_minimumVersion (minVersion)
510 {
511 }
512
iterate(void)513 CombinedUniformComponentsCase::IterateResult CombinedUniformComponentsCase::iterate (void)
514 {
515 if (!contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 5)))
516 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(m_context.getRenderContext().getType(), m_minimumVersion), "Test not supported in this context.");
517
518 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
519 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
520
521 const glw::GLenum maxUniformBlocksEnum = (m_target == GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS) ? GL_MAX_COMPUTE_UNIFORM_BLOCKS
522 : (m_target == GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS) ? GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS
523 : (m_target == GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS) ? GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS
524 : (m_target == GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS) ? GL_MAX_GEOMETRY_UNIFORM_BLOCKS
525 : -1;
526
527 const glw::GLenum maxUniformComponentsEnum = (m_target == GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS) ? GL_MAX_COMPUTE_UNIFORM_COMPONENTS
528 : (m_target == GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS) ? GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS
529 : (m_target == GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS) ? GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS
530 : (m_target == GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS) ? GL_MAX_GEOMETRY_UNIFORM_COMPONENTS
531 : -1;
532
533 gl.enableLogging(true);
534
535 m_testCtx.getLog() << tcu::TestLog::Message
536 << "The minimum value of MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS is MAX_COMPUTE_UNIFORM_BLOCKS x MAX_UNIFORM_BLOCK_SIZE / 4 + MAX_COMPUTE_UNIFORM_COMPONENTS"
537 << tcu::TestLog::EndMessage;
538
539 StateQueryMemoryWriteGuard<glw::GLint> maxUniformBlocks;
540 gl.glGetIntegerv(maxUniformBlocksEnum, &maxUniformBlocks);
541 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGetIntegerv");
542
543 StateQueryMemoryWriteGuard<glw::GLint> maxUniformBlockSize;
544 gl.glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
545 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGetIntegerv");
546
547 StateQueryMemoryWriteGuard<glw::GLint> maxUniformComponents;
548 gl.glGetIntegerv(maxUniformComponentsEnum, &maxUniformComponents);
549 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGetIntegerv");
550
551 if (maxUniformBlocks.verifyValidity(result) && maxUniformBlockSize.verifyValidity(result) && maxUniformComponents.verifyValidity(result))
552 verifyStateIntegerMin(result, gl, m_target, ((int)maxUniformBlocks) * ((int)maxUniformBlockSize) / 4 + (int)maxUniformComponents, m_verifierType);
553
554 result.setTestContextResult(m_testCtx);
555 return STOP;
556 }
557
558 class TextureGatherLimitCase : public TestCase
559 {
560 public:
561 TextureGatherLimitCase (Context& context, const char* name, const char* desc, bool isMaxCase, QueryType verifierType);
562 private:
563 IterateResult iterate (void);
564
565 const bool m_isMaxCase;
566 const QueryType m_verifierType;
567 };
568
TextureGatherLimitCase(Context & context,const char * name,const char * desc,bool isMaxCase,QueryType verifierType)569 TextureGatherLimitCase::TextureGatherLimitCase (Context& context, const char* name, const char* desc, bool isMaxCase, QueryType verifierType)
570 : TestCase (context, name, desc)
571 , m_isMaxCase (isMaxCase)
572 , m_verifierType (verifierType)
573 {
574 }
575
iterate(void)576 TextureGatherLimitCase::IterateResult TextureGatherLimitCase::iterate (void)
577 {
578 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
579 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
580
581 gl.enableLogging(true);
582
583 if (m_isMaxCase)
584 {
585 // range [0, inf)
586 verifyStateIntegerMin(result, gl, GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET, 0, m_verifierType);
587 }
588 else
589 {
590 // range (-inf, 0]
591 verifyStateIntegerMax(result, gl, GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET, 0, m_verifierType);
592 }
593
594 result.setTestContextResult(m_testCtx);
595 return STOP;
596 }
597
598 class MaxUniformBufferBindingsCase : public TestCase
599 {
600 public:
601 MaxUniformBufferBindingsCase (Context& context, const char* name, const char* desc, QueryType verifierType);
602 private:
603 IterateResult iterate (void);
604
605 const QueryType m_verifierType;
606 };
607
MaxUniformBufferBindingsCase(Context & context,const char * name,const char * desc,QueryType verifierType)608 MaxUniformBufferBindingsCase::MaxUniformBufferBindingsCase (Context& context, const char* name, const char* desc, QueryType verifierType)
609 : TestCase (context, name, desc)
610 , m_verifierType (verifierType)
611 {
612 }
613
iterate(void)614 MaxUniformBufferBindingsCase::IterateResult MaxUniformBufferBindingsCase::iterate (void)
615 {
616 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
617 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
618 int minMax;
619
620 gl.enableLogging(true);
621
622 if (contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
623 {
624 minMax = 72;
625 }
626 else
627 {
628 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_tessellation_shader"))
629 {
630 m_testCtx.getLog() << tcu::TestLog::Message
631 << "GL_EXT_tessellation_shader increases the minimum value of GL_MAX_UNIFORM_BUFFER_BINDINGS to 72"
632 << tcu::TestLog::EndMessage;
633 minMax = 72;
634 }
635 else if (m_context.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader"))
636 {
637 m_testCtx.getLog() << tcu::TestLog::Message
638 << "GL_EXT_geometry_shader increases the minimum value of GL_MAX_UNIFORM_BUFFER_BINDINGS to 48"
639 << tcu::TestLog::EndMessage;
640 minMax = 48;
641 }
642 else
643 {
644 minMax = 36;
645 }
646 }
647
648 // range [0, inf)
649 verifyStateIntegerMin(result, gl, GL_MAX_UNIFORM_BUFFER_BINDINGS, minMax, m_verifierType);
650
651 result.setTestContextResult(m_testCtx);
652 return STOP;
653 }
654
655 class MaxCombinedUniformBlocksCase : public TestCase
656 {
657 public:
658 MaxCombinedUniformBlocksCase (Context& context, const char* name, const char* desc, QueryType verifierType);
659 private:
660 IterateResult iterate (void);
661
662 const QueryType m_verifierType;
663 };
664
MaxCombinedUniformBlocksCase(Context & context,const char * name,const char * desc,QueryType verifierType)665 MaxCombinedUniformBlocksCase::MaxCombinedUniformBlocksCase (Context& context, const char* name, const char* desc, QueryType verifierType)
666 : TestCase (context, name, desc)
667 , m_verifierType (verifierType)
668 {
669 }
670
iterate(void)671 MaxCombinedUniformBlocksCase::IterateResult MaxCombinedUniformBlocksCase::iterate (void)
672 {
673 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
674 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
675 int minMax;
676
677 gl.enableLogging(true);
678
679 if (contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
680 {
681 minMax = 60;
682 }
683 else
684 {
685 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_tessellation_shader"))
686 {
687 m_testCtx.getLog() << tcu::TestLog::Message
688 << "GL_EXT_tessellation_shader increases the minimum value of GL_MAX_COMBINED_UNIFORM_BLOCKS to 60"
689 << tcu::TestLog::EndMessage;
690 minMax = 60;
691 }
692 else if (m_context.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader"))
693 {
694 m_testCtx.getLog() << tcu::TestLog::Message
695 << "GL_EXT_geometry_shader increases the minimum value of GL_MAX_COMBINED_UNIFORM_BLOCKS to 36"
696 << tcu::TestLog::EndMessage;
697 minMax = 36;
698 }
699 else
700 {
701 minMax = 24;
702 }
703 }
704
705 // range [0, inf)
706 verifyStateIntegerMin(result, gl, GL_MAX_COMBINED_UNIFORM_BLOCKS, minMax, m_verifierType);
707
708 result.setTestContextResult(m_testCtx);
709 return STOP;
710 }
711
712 class MaxCombinedTexImageUnitsCase : public TestCase
713 {
714 public:
715 MaxCombinedTexImageUnitsCase (Context& context, const char* name, const char* desc, QueryType verifierType);
716 private:
717 IterateResult iterate (void);
718
719 const QueryType m_verifierType;
720 };
721
MaxCombinedTexImageUnitsCase(Context & context,const char * name,const char * desc,QueryType verifierType)722 MaxCombinedTexImageUnitsCase::MaxCombinedTexImageUnitsCase (Context& context, const char* name, const char* desc, QueryType verifierType)
723 : TestCase (context, name, desc)
724 , m_verifierType (verifierType)
725 {
726 }
727
iterate(void)728 MaxCombinedTexImageUnitsCase::IterateResult MaxCombinedTexImageUnitsCase::iterate (void)
729 {
730 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
731 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
732 int minMax;
733
734 gl.enableLogging(true);
735 if (contextSupports(m_context.getRenderContext().getType(), glu::ApiType::es(3, 2)))
736 {
737 minMax = 96;
738 }
739 else
740 {
741 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_tessellation_shader"))
742 {
743 m_testCtx.getLog() << tcu::TestLog::Message
744 << "GL_EXT_tessellation_shader increases the minimum value of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS to 96"
745 << tcu::TestLog::EndMessage;
746 minMax = 96;
747 }
748 else if (m_context.getContextInfo().isExtensionSupported("GL_EXT_geometry_shader"))
749 {
750 m_testCtx.getLog() << tcu::TestLog::Message
751 << "GL_EXT_geometry_shader increases the minimum value of GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS to 36"
752 << tcu::TestLog::EndMessage;
753 minMax = 64;
754 }
755 else
756 {
757 minMax = 48;
758 }
759 }
760
761 // range [0, inf)
762 verifyStateIntegerMin(result, gl, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, minMax, m_verifierType);
763
764 result.setTestContextResult(m_testCtx);
765 return STOP;
766 }
767
768 } // anonymous
769
IntegerStateQueryTests(Context & context)770 IntegerStateQueryTests::IntegerStateQueryTests (Context& context)
771 : TestCaseGroup(context, "integer", "Integer state query tests")
772 {
773 }
774
~IntegerStateQueryTests(void)775 IntegerStateQueryTests::~IntegerStateQueryTests (void)
776 {
777 }
778
init(void)779 void IntegerStateQueryTests::init (void)
780 {
781 // Verifiers
782 const QueryType verifiers[] = { QUERY_BOOLEAN, QUERY_INTEGER, QUERY_INTEGER64, QUERY_FLOAT };
783
784 #define FOR_EACH_VERIFIER(X) \
785 for (int verifierNdx = 0; verifierNdx < DE_LENGTH_OF_ARRAY(verifiers); ++verifierNdx) \
786 { \
787 const char* verifierSuffix = getVerifierSuffix(verifiers[verifierNdx]); \
788 const QueryType verifier = verifiers[verifierNdx]; \
789 this->addChild(X); \
790 }
791
792 FOR_EACH_VERIFIER(new MaxSamplesCase(m_context, (std::string() + "max_color_texture_samples_" + verifierSuffix).c_str(), "Test GL_MAX_COLOR_TEXTURE_SAMPLES", GL_MAX_COLOR_TEXTURE_SAMPLES, 1, verifier))
793 FOR_EACH_VERIFIER(new MaxSamplesCase(m_context, (std::string() + "max_depth_texture_samples_" + verifierSuffix).c_str(), "Test GL_MAX_DEPTH_TEXTURE_SAMPLES", GL_MAX_DEPTH_TEXTURE_SAMPLES, 1, verifier))
794 FOR_EACH_VERIFIER(new MaxSamplesCase(m_context, (std::string() + "max_integer_samples_" + verifierSuffix).c_str(), "Test GL_MAX_INTEGER_SAMPLES", GL_MAX_INTEGER_SAMPLES, 1, verifier))
795
796 FOR_EACH_VERIFIER(new TexBindingCase(m_context, (std::string() + "texture_binding_2d_multisample_" + verifierSuffix).c_str(), "Test TEXTURE_BINDING_2D_MULTISAMPLE", GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_BINDING_2D_MULTISAMPLE, verifier))
797 FOR_EACH_VERIFIER(new TexBindingCase(m_context, (std::string() + "texture_binding_2d_multisample_array_" + verifierSuffix).c_str(), "Test TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, verifier))
798 FOR_EACH_VERIFIER(new TexBindingCase(m_context, (std::string() + "texture_binding_cube_map_array_" + verifierSuffix).c_str(), "Test TEXTURE_BINDING_CUBE_MAP_ARRAY", GL_TEXTURE_CUBE_MAP_ARRAY, GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, verifier))
799 FOR_EACH_VERIFIER(new TexBindingCase(m_context, (std::string() + "texture_binding_buffer_" + verifierSuffix).c_str(), "Test TEXTURE_BINDING_BUFFER", GL_TEXTURE_BUFFER, GL_TEXTURE_BINDING_BUFFER, verifier))
800
801 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_attrib_relative_offset_" + verifierSuffix).c_str(), "Test MAX_VERTEX_ATTRIB_RELATIVE_OFFSET", GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET, 2047, verifier))
802 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_attrib_bindings_" + verifierSuffix).c_str(), "Test MAX_VERTEX_ATTRIB_BINDINGS", GL_MAX_VERTEX_ATTRIB_BINDINGS, 16, verifier))
803 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_attrib_stride_" + verifierSuffix).c_str(), "Test MAX_VERTEX_ATTRIB_STRIDE", GL_MAX_VERTEX_ATTRIB_STRIDE, 2048, verifier))
804 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_sample_mask_words_" + verifierSuffix).c_str(), "Test MAX_SAMPLE_MASK_WORDS", GL_MAX_SAMPLE_MASK_WORDS, 1, verifier))
805
806 FOR_EACH_VERIFIER(new AlignmentCase(m_context, (std::string() + "shader_storage_buffer_offset_alignment_" + verifierSuffix).c_str(), "Test SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT", GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, 256, verifier))
807
808 FOR_EACH_VERIFIER(new BufferBindingCase(m_context, (std::string() + "draw_indirect_buffer_binding_" + verifierSuffix).c_str(), "Test DRAW_INDIRECT_BUFFER_BINDING", GL_DRAW_INDIRECT_BUFFER_BINDING, GL_DRAW_INDIRECT_BUFFER, verifier))
809 FOR_EACH_VERIFIER(new BufferBindingCase(m_context, (std::string() + "atomic_counter_buffer_binding_" + verifierSuffix).c_str(), "Test ATOMIC_COUNTER_BUFFER_BINDING", GL_ATOMIC_COUNTER_BUFFER_BINDING, GL_ATOMIC_COUNTER_BUFFER, verifier))
810 FOR_EACH_VERIFIER(new BufferBindingCase(m_context, (std::string() + "shader_storage_buffer_binding_" + verifierSuffix).c_str(), "Test SHADER_STORAGE_BUFFER_BINDING", GL_SHADER_STORAGE_BUFFER_BINDING, GL_SHADER_STORAGE_BUFFER, verifier))
811 FOR_EACH_VERIFIER(new BufferBindingCase(m_context, (std::string() + "dispatch_indirect_buffer_binding_" + verifierSuffix).c_str(), "Test DISPATCH_INDIRECT_BUFFER_BINDING", GL_DISPATCH_INDIRECT_BUFFER_BINDING, GL_DISPATCH_INDIRECT_BUFFER, verifier))
812
813 FOR_EACH_VERIFIER(new FramebufferMinimumValueCase(m_context, (std::string() + "max_framebuffer_width_" + verifierSuffix).c_str(), "Test MAX_FRAMEBUFFER_WIDTH", GL_MAX_FRAMEBUFFER_WIDTH, 2048, GL_MAX_TEXTURE_SIZE, verifier))
814 FOR_EACH_VERIFIER(new FramebufferMinimumValueCase(m_context, (std::string() + "max_framebuffer_height_" + verifierSuffix).c_str(), "Test MAX_FRAMEBUFFER_HEIGHT", GL_MAX_FRAMEBUFFER_HEIGHT, 2048, GL_MAX_TEXTURE_SIZE, verifier))
815 FOR_EACH_VERIFIER(new FramebufferMinimumValueCase(m_context, (std::string() + "max_framebuffer_samples_" + verifierSuffix).c_str(), "Test MAX_FRAMEBUFFER_SAMPLES", GL_MAX_FRAMEBUFFER_SAMPLES, 4, GL_MAX_SAMPLES, verifier))
816
817 FOR_EACH_VERIFIER(new ProgramPipelineBindingCase(m_context, (std::string() + "program_pipeline_binding_" + verifierSuffix).c_str(), "Test PROGRAM_PIPELINE_BINDING", verifier))
818
819 // vertex
820 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_VERTEX_ATOMIC_COUNTER_BUFFERS", GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS, 0, verifier))
821 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_VERTEX_ATOMIC_COUNTERS", GL_MAX_VERTEX_ATOMIC_COUNTERS, 0, verifier))
822 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_VERTEX_IMAGE_UNIFORMS", GL_MAX_VERTEX_IMAGE_UNIFORMS, 0, verifier))
823 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_VERTEX_SHADER_STORAGE_BLOCKS", GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, 0, verifier))
824 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_vertex_uniform_components_" + verifierSuffix).c_str(), "Test MAX_VERTEX_UNIFORM_COMPONENTS", GL_MAX_VERTEX_UNIFORM_COMPONENTS, 1024, verifier))
825
826 // fragment
827 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_fragment_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS", GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, 0, verifier))
828 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_fragment_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_ATOMIC_COUNTERS", GL_MAX_FRAGMENT_ATOMIC_COUNTERS, 0, verifier))
829 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_fragment_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_IMAGE_UNIFORMS", GL_MAX_FRAGMENT_IMAGE_UNIFORMS, 0, verifier))
830 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_fragment_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_SHADER_STORAGE_BLOCKS", GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS, 0, verifier))
831 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_fragment_uniform_components_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_UNIFORM_COMPONENTS", GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 1024, verifier))
832
833 // compute
834 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_work_group_invocations_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_WORK_GROUP_INVOCATIONS", GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, 128, verifier))
835 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_uniform_blocks_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_UNIFORM_BLOCKS", GL_MAX_COMPUTE_UNIFORM_BLOCKS, 12, verifier))
836 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_texture_image_units_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_TEXTURE_IMAGE_UNITS", GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, 16, verifier))
837 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_shared_memory_size_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_SHARED_MEMORY_SIZE", GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, 16384, verifier))
838 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_uniform_components_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_UNIFORM_COMPONENTS", GL_MAX_COMPUTE_UNIFORM_COMPONENTS, 1024, verifier))
839 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS", GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS, 1, verifier))
840 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_ATOMIC_COUNTERS", GL_MAX_COMPUTE_ATOMIC_COUNTERS, 8, verifier))
841 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_IMAGE_UNIFORMS", GL_MAX_COMPUTE_IMAGE_UNIFORMS, 4, verifier))
842 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_compute_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_SHADER_STORAGE_BLOCKS", GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS, 4, verifier))
843
844 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_uniform_locations_" + verifierSuffix).c_str(), "Test MAX_UNIFORM_LOCATIONS", GL_MAX_UNIFORM_LOCATIONS, 1024, verifier))
845 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_atomic_counter_buffer_bindings_" + verifierSuffix).c_str(), "Test MAX_ATOMIC_COUNTER_BUFFER_BINDINGS", GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, 1, verifier))
846 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_atomic_counter_buffer_size_" + verifierSuffix).c_str(), "Test MAX_ATOMIC_COUNTER_BUFFER_SIZE", GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, 32, verifier))
847 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_combined_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_COMBINED_ATOMIC_COUNTER_BUFFERS", GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS, 1, verifier))
848 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_combined_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_COMBINED_ATOMIC_COUNTERS", GL_MAX_COMBINED_ATOMIC_COUNTERS, 8, verifier))
849 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_image_units_" + verifierSuffix).c_str(), "Test MAX_IMAGE_UNITS", GL_MAX_IMAGE_UNITS, 4, verifier))
850 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_combined_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_COMBINED_IMAGE_UNIFORMS", GL_MAX_COMBINED_IMAGE_UNIFORMS, 4, verifier))
851 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_shader_storage_buffer_bindings_" + verifierSuffix).c_str(), "Test MAX_SHADER_STORAGE_BUFFER_BINDINGS", GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, 4, verifier))
852 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_shader_storage_block_size_" + verifierSuffix).c_str(), "Test MAX_SHADER_STORAGE_BLOCK_SIZE", GL_MAX_SHADER_STORAGE_BLOCK_SIZE, 1<<27, verifier))
853 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_combined_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_COMBINED_SHADER_STORAGE_BLOCKS", GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS, 4, verifier))
854 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_combined_shader_output_resources_" + verifierSuffix).c_str(), "Test MAX_COMBINED_SHADER_OUTPUT_RESOURCES", GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, 4, verifier))
855
856 FOR_EACH_VERIFIER(new MaxUniformBufferBindingsCase (m_context, (std::string() + "max_uniform_buffer_bindings_" + verifierSuffix).c_str(), "Test MAX_UNIFORM_BUFFER_BINDINGS", verifier))
857 FOR_EACH_VERIFIER(new MaxCombinedUniformBlocksCase (m_context, (std::string() + "max_combined_uniform_blocks_" + verifierSuffix).c_str(), "Test MAX_COMBINED_UNIFORM_BLOCKS", verifier))
858 FOR_EACH_VERIFIER(new MaxCombinedTexImageUnitsCase (m_context, (std::string() + "max_combined_texture_image_units_" + verifierSuffix).c_str(), "Test MAX_COMBINED_TEXTURE_IMAGE_UNITS", verifier))
859 FOR_EACH_VERIFIER(new CombinedUniformComponentsCase (m_context, (std::string() + "max_combined_compute_uniform_components_" + verifierSuffix).c_str(), "Test MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS", GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS, verifier))
860
861 FOR_EACH_VERIFIER(new LegacyVectorLimitCase(m_context, (std::string() + "max_vertex_uniform_vectors_" + verifierSuffix).c_str(), "Test MAX_VERTEX_UNIFORM_VECTORS", GL_MAX_VERTEX_UNIFORM_VECTORS, GL_MAX_VERTEX_UNIFORM_COMPONENTS, verifier))
862 FOR_EACH_VERIFIER(new LegacyVectorLimitCase(m_context, (std::string() + "max_fragment_uniform_vectors_" + verifierSuffix).c_str(), "Test MAX_FRAGMENT_UNIFORM_VECTORS", GL_MAX_FRAGMENT_UNIFORM_VECTORS, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, verifier))
863
864 FOR_EACH_VERIFIER(new TextureGatherLimitCase(m_context, (std::string() + "min_program_texture_gather_offset_" + verifierSuffix).c_str(), "Test MIN_PROGRAM_TEXTURE_GATHER_OFFSET", false, verifier))
865 FOR_EACH_VERIFIER(new TextureGatherLimitCase(m_context, (std::string() + "max_program_texture_gather_offset_" + verifierSuffix).c_str(), "Test MAX_PROGRAM_TEXTURE_GATHER_OFFSET", true, verifier))
866
867 // GL ES 3.2 tests
868 FOR_EACH_VERIFIER(new MinimumValueCase (m_context, (std::string() + "max_framebuffer_layers_" + verifierSuffix).c_str(), "Test MAX_FRAMEBUFFER_LAYERS", GL_MAX_FRAMEBUFFER_LAYERS, 256, verifier, glu::ApiType::es(3, 2)))
869 FOR_EACH_VERIFIER(new MinimumValueCase (m_context, (std::string() + "fragment_interpolation_offset_bits_" + verifierSuffix).c_str(), "Test FRAGMENT_INTERPOLATION_OFFSET_BITS", GL_FRAGMENT_INTERPOLATION_OFFSET_BITS, 4, verifier, glu::ApiType::es(3, 2)))
870 FOR_EACH_VERIFIER(new MinimumValueCase (m_context, (std::string() + "max_texture_buffer_size_" + verifierSuffix).c_str(), "Test MAX_TEXTURE_BUFFER_SIZE", GL_MAX_TEXTURE_BUFFER_SIZE, 65536, verifier, glu::ApiType::es(3, 2)))
871 FOR_EACH_VERIFIER(new AlignmentCase (m_context, (std::string() + "texture_buffer_offset_alignment_" + verifierSuffix).c_str(), "Test TEXTURE_BUFFER_OFFSET_ALIGNMENT", GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, 256, verifier, glu::ApiType::es(3, 2)))
872
873 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_gen_level_" + verifierSuffix).c_str(), "Test MAX_TESS_GEN_LEVEL", GL_MAX_TESS_GEN_LEVEL, 64, verifier, glu::ApiType::es(3, 2)))
874 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_patch_vertices_" + verifierSuffix).c_str(), "Test MAX_PATCH_VERTICES", GL_MAX_PATCH_VERTICES, 32, verifier, glu::ApiType::es(3, 2)))
875 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_patch_components_" + verifierSuffix).c_str(), "Test MAX_TESS_PATCH_COMPONENTS", GL_MAX_TESS_PATCH_COMPONENTS, 120, verifier, glu::ApiType::es(3, 2)))
876
877 // tess control
878 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_uniform_components_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_UNIFORM_COMPONENTS", GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, 1024, verifier, glu::ApiType::es(3, 2)))
879 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_texture_image_units_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS", GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, 16, verifier, glu::ApiType::es(3, 2)))
880 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_output_components_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_OUTPUT_COMPONENTS", GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
881 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_total_output_components_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS", GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS, 2048, verifier, glu::ApiType::es(3, 2)))
882 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_input_components_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_INPUT_COMPONENTS", GL_MAX_TESS_CONTROL_INPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
883 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_uniform_blocks_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_UNIFORM_BLOCKS", GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, 12, verifier, glu::ApiType::es(3, 2)))
884 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS", GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS, 0, verifier, glu::ApiType::es(3, 2)))
885 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_ATOMIC_COUNTERS", GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS, 0, verifier, glu::ApiType::es(3, 2)))
886 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS", GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS, 0, verifier, glu::ApiType::es(3, 2)))
887
888 // tess evaluation
889 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_uniform_components_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_UNIFORM_COMPONENTS", GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS, 1024, verifier, glu::ApiType::es(3, 2)))
890 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_texture_image_units_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS", GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, 16, verifier, glu::ApiType::es(3, 2)))
891 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_output_components_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_OUTPUT_COMPONENTS", GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
892 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_input_components_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_INPUT_COMPONENTS", GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
893 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_uniform_blocks_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_UNIFORM_BLOCKS", GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, 12, verifier, glu::ApiType::es(3, 2)))
894 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS", GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS, 0, verifier, glu::ApiType::es(3, 2)))
895 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_ATOMIC_COUNTERS", GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS, 0, verifier, glu::ApiType::es(3, 2)))
896 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS", GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS, 0, verifier, glu::ApiType::es(3, 2)))
897
898 // geometry
899 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_uniform_components_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_UNIFORM_COMPONENTS", GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, 1024, verifier, glu::ApiType::es(3, 2)))
900 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_uniform_blocks_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_UNIFORM_BLOCKS", GL_MAX_GEOMETRY_UNIFORM_BLOCKS, 12, verifier, glu::ApiType::es(3, 2)))
901 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_input_components_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_INPUT_COMPONENTS", GL_MAX_GEOMETRY_INPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
902 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_output_components_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_OUTPUT_COMPONENTS", GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, 64, verifier, glu::ApiType::es(3, 2)))
903 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_output_vertices_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_OUTPUT_VERTICES", GL_MAX_GEOMETRY_OUTPUT_VERTICES, 256, verifier, glu::ApiType::es(3, 2)))
904 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_total_output_components_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, 1024, verifier, glu::ApiType::es(3, 2)))
905 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_texture_image_units_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_TEXTURE_IMAGE_UNITS", GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, 16, verifier, glu::ApiType::es(3, 2)))
906 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_shader_invocations_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_SHADER_INVOCATIONS", GL_MAX_GEOMETRY_SHADER_INVOCATIONS, 32, verifier, glu::ApiType::es(3, 2)))
907 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_atomic_counter_buffers_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS", GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS, 0, verifier, glu::ApiType::es(3, 2)))
908 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_atomic_counters_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_ATOMIC_COUNTERS", GL_MAX_GEOMETRY_ATOMIC_COUNTERS, 0, verifier, glu::ApiType::es(3, 2)))
909 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_shader_storage_blocks_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_SHADER_STORAGE_BLOCKS", GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS, 0, verifier, glu::ApiType::es(3, 2)))
910
911 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_control_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_TESS_CONTROL_IMAGE_UNIFORMS", GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS, 0, verifier, glu::ApiType::es(3, 2)))
912 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_tess_evaluation_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_TESS_EVALUATION_IMAGE_UNIFORMS", GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS, 0, verifier, glu::ApiType::es(3, 2)))
913 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_geometry_image_uniforms_" + verifierSuffix).c_str(), "Test MAX_GEOMETRY_IMAGE_UNIFORMS", GL_MAX_GEOMETRY_IMAGE_UNIFORMS, 0, verifier, glu::ApiType::es(3, 2)))
914
915 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "debug_logged_messages_" + verifierSuffix).c_str(), "Test DEBUG_LOGGED_MESSAGES", GL_DEBUG_LOGGED_MESSAGES, 0, verifier, glu::ApiType::es(3, 2)))
916 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "debug_next_logged_message_length_" + verifierSuffix).c_str(), "Test DEBUG_NEXT_LOGGED_MESSAGE_LENGTH", GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH, 0, verifier, glu::ApiType::es(3, 2)))
917 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "debug_group_stack_depth_" + verifierSuffix).c_str(), "Test DEBUG_GROUP_STACK_DEPTH", GL_DEBUG_GROUP_STACK_DEPTH, 0, verifier, glu::ApiType::es(3, 2)))
918 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_debug_message_length_" + verifierSuffix).c_str(), "Test MAX_DEBUG_MESSAGE_LENGTH", GL_MAX_DEBUG_MESSAGE_LENGTH, 1, verifier, glu::ApiType::es(3, 2)))
919 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_debug_logged_messages_" + verifierSuffix).c_str(), "Test MAX_DEBUG_LOGGED_MESSAGES", GL_MAX_DEBUG_LOGGED_MESSAGES, 1, verifier, glu::ApiType::es(3, 2)))
920 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_debug_group_stack_depth_" + verifierSuffix).c_str(), "Test MAX_DEBUG_GROUP_STACK_DEPTH", GL_MAX_DEBUG_GROUP_STACK_DEPTH, 64, verifier, glu::ApiType::es(3, 2)))
921 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "max_label_length_" + verifierSuffix).c_str(), "Test MAX_LABEL_LENGTH", GL_MAX_LABEL_LENGTH, 256, verifier, glu::ApiType::es(3, 2)))
922
923 FOR_EACH_VERIFIER(new MinimumValueCase(m_context, (std::string() + "texture_buffer_binding_" + verifierSuffix).c_str(), "Test TEXTURE_BUFFER_BINDING", GL_TEXTURE_BUFFER_BINDING, 0, verifier, glu::ApiType::es(3, 2)))
924
925 FOR_EACH_VERIFIER(new CombinedUniformComponentsCase (m_context, (std::string() + "max_combined_tess_control_uniform_components_" + verifierSuffix).c_str(), "Test MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS", GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS, verifier, glu::ApiType::es(3, 2)))
926 FOR_EACH_VERIFIER(new CombinedUniformComponentsCase (m_context, (std::string() + "max_combined_tess_evaluation_uniform_components_" + verifierSuffix).c_str(), "Test MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS", GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS, verifier, glu::ApiType::es(3, 2)))
927 FOR_EACH_VERIFIER(new CombinedUniformComponentsCase (m_context, (std::string() + "max_combined_geometry_uniform_components_" + verifierSuffix).c_str(), "Test MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, verifier, glu::ApiType::es(3, 2)))
928
929 #undef FOR_EACH_VERIFIER
930 }
931
932 } // Functional
933 } // gles31
934 } // deqp
935