1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.1 Module
3 * -------------------------------------------------
5 * Copyright 2015 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief Indexed state query tests
22 *//*--------------------------------------------------------------------*/
24 #include "es31fIndexedStateQueryTests.hpp"
25 #include "tcuTestLog.hpp"
26 #include "tcuFormatUtil.hpp"
27 #include "gluRenderContext.hpp"
28 #include "gluCallLogWrapper.hpp"
29 #include "gluStrUtil.hpp"
30 #include "gluContextInfo.hpp"
31 #include "gluObjectWrapper.hpp"
32 #include "glwFunctions.hpp"
33 #include "glwEnums.hpp"
34 #include "glsStateQueryUtil.hpp"
35 #include "deRandom.hpp"
36 #include "deStringUtil.hpp"
47 using namespace gls::StateQueryUtil;
49 static const char* getVerifierSuffix (QueryType type)
53 case QUERY_INDEXED_BOOLEAN: return "getbooleani_v";
54 case QUERY_INDEXED_INTEGER: return "getintegeri_v";
55 case QUERY_INDEXED_INTEGER64: return "getinteger64i_v";
56 case QUERY_INDEXED_BOOLEAN_VEC4: return "getbooleani_v";
57 case QUERY_INDEXED_INTEGER_VEC4: return "getintegeri_v";
58 case QUERY_INDEXED_INTEGER64_VEC4: return "getinteger64i_v";
59 case QUERY_INDEXED_ISENABLED: return "isenabledi";
66 void isExtensionSupported (Context& context, std::string extensionName)
68 if (extensionName == "GL_EXT_draw_buffers_indexed" || extensionName == "GL_KHR_blend_equation_advanced")
70 if (!contextSupports(context.getRenderContext().getType(), glu::ApiType::es(3, 2)) && !context.getContextInfo().isExtensionSupported(extensionName.c_str()))
71 TCU_THROW(NotSupportedError, (std::string("Extension ") + extensionName + std::string(" not supported.")).c_str());
73 else if (!context.getContextInfo().isExtensionSupported(extensionName.c_str()))
74 TCU_THROW(NotSupportedError, (std::string("Extension ") + extensionName + std::string(" not supported.")).c_str());
77 class SampleMaskCase : public TestCase
80 SampleMaskCase (Context& context, const char* name, const char* desc, QueryType verifierType);
84 IterateResult iterate (void);
86 const QueryType m_verifierType;
87 int m_maxSampleMaskWords;
90 SampleMaskCase::SampleMaskCase (Context& context, const char* name, const char* desc, QueryType verifierType)
91 : TestCase (context, name, desc)
92 , m_verifierType (verifierType)
93 , m_maxSampleMaskWords (-1)
97 void SampleMaskCase::init (void)
99 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
101 gl.getIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &m_maxSampleMaskWords);
102 GLU_EXPECT_NO_ERROR(gl.getError(), "query sample mask words");
104 // mask word count ok?
105 if (m_maxSampleMaskWords <= 0)
106 throw tcu::TestError("Minimum value of GL_MAX_SAMPLE_MASK_WORDS is 1. Got " + de::toString(m_maxSampleMaskWords));
108 m_testCtx.getLog() << tcu::TestLog::Message << "GL_MAX_SAMPLE_MASK_WORDS = " << m_maxSampleMaskWords << tcu::TestLog::EndMessage;
111 SampleMaskCase::IterateResult SampleMaskCase::iterate (void)
113 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
114 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
116 gl.enableLogging(true);
120 const tcu::ScopedLogSection section(m_testCtx.getLog(), "initial", "Initial values");
122 for (int ndx = 0; ndx < m_maxSampleMaskWords; ++ndx)
123 verifyStateIndexedInteger(result, gl, GL_SAMPLE_MASK_VALUE, ndx, -1, m_verifierType);
128 const tcu::ScopedLogSection section(m_testCtx.getLog(), "fixed", "Fixed values");
130 for (int ndx = 0; ndx < m_maxSampleMaskWords; ++ndx)
132 gl.glSampleMaski(ndx, 0);
133 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glSampleMaski");
135 verifyStateIndexedInteger(result, gl, GL_SAMPLE_MASK_VALUE, ndx, 0, m_verifierType);
141 const int numRandomTest = 20;
142 const tcu::ScopedLogSection section (m_testCtx.getLog(), "random", "Random values");
143 de::Random rnd (0x4312);
145 for (int testNdx = 0; testNdx < numRandomTest; ++testNdx)
147 const glw::GLint maskIndex = (glw::GLint)(rnd.getUint32() % m_maxSampleMaskWords);
148 glw::GLint mask = (glw::GLint)(rnd.getUint32());
150 gl.glSampleMaski(maskIndex, mask);
151 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glSampleMaski");
153 verifyStateIndexedInteger(result, gl, GL_SAMPLE_MASK_VALUE, maskIndex, mask, m_verifierType);
157 result.setTestContextResult(m_testCtx);
161 class MinValueIndexed3Case : public TestCase
164 MinValueIndexed3Case (Context& context, const char* name, const char* desc, glw::GLenum target, const tcu::IVec3& ref, QueryType verifierType);
167 IterateResult iterate (void);
169 const glw::GLenum m_target;
170 const tcu::IVec3 m_ref;
171 const QueryType m_verifierType;
174 MinValueIndexed3Case::MinValueIndexed3Case (Context& context, const char* name, const char* desc, glw::GLenum target, const tcu::IVec3& ref, QueryType verifierType)
175 : TestCase (context, name, desc)
178 , m_verifierType (verifierType)
182 MinValueIndexed3Case::IterateResult MinValueIndexed3Case::iterate (void)
184 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
185 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
187 gl.enableLogging(true);
189 for (int ndx = 0; ndx < 3; ++ndx)
191 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Element", "Element " + de::toString(ndx));
193 verifyStateIndexedIntegerMin(result, gl, m_target, ndx, m_ref[ndx], m_verifierType);
196 result.setTestContextResult(m_testCtx);
200 class BufferBindingCase : public TestCase
203 BufferBindingCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType);
206 IterateResult iterate (void);
208 const glw::GLenum m_queryTarget;
209 const glw::GLenum m_bufferTarget;
210 const glw::GLenum m_numBindingsTarget;
211 const QueryType m_verifierType;
214 BufferBindingCase::BufferBindingCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType)
215 : TestCase (context, name, desc)
216 , m_queryTarget (queryTarget)
217 , m_bufferTarget (bufferTarget)
218 , m_numBindingsTarget (numBindingsTarget)
219 , m_verifierType (verifierType)
223 BufferBindingCase::IterateResult BufferBindingCase::iterate (void)
225 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
226 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
227 int maxBindings = -1;
229 gl.enableLogging(true);
231 gl.glGetIntegerv(m_numBindingsTarget, &maxBindings);
232 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
235 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
237 for (int ndx = 0; ndx < maxBindings; ++ndx)
238 verifyStateIndexedInteger(result, gl, m_queryTarget, ndx, 0, m_verifierType);
242 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
243 glu::Buffer bufferA (m_context.getRenderContext());
244 glu::Buffer bufferB (m_context.getRenderContext());
246 const int ndxB = maxBindings / 2;
249 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Generic", "After setting generic binding point");
251 gl.glBindBuffer(m_bufferTarget, *bufferA);
252 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glBindBuffer");
254 verifyStateIndexedInteger(result, gl, m_queryTarget, 0, 0, m_verifierType);
257 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferBase");
259 gl.glBindBufferBase(m_bufferTarget, ndxA, *bufferA);
260 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glBindBufferBase");
262 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, *bufferA, m_verifierType);
265 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferRange");
267 gl.glBindBufferRange(m_bufferTarget, ndxB, *bufferB, 0, 8);
268 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glBindBufferRange");
270 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxB, *bufferB, m_verifierType);
274 const tcu::ScopedLogSection section(m_testCtx.getLog(), "DifferentStates", "Original state did not change");
276 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, *bufferA, m_verifierType);
280 result.setTestContextResult(m_testCtx);
284 class BufferStartCase : public TestCase
287 BufferStartCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType);
290 IterateResult iterate (void);
292 const glw::GLenum m_queryTarget;
293 const glw::GLenum m_bufferTarget;
294 const glw::GLenum m_numBindingsTarget;
295 const QueryType m_verifierType;
298 BufferStartCase::BufferStartCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType)
299 : TestCase (context, name, desc)
300 , m_queryTarget (queryTarget)
301 , m_bufferTarget (bufferTarget)
302 , m_numBindingsTarget (numBindingsTarget)
303 , m_verifierType (verifierType)
307 BufferStartCase::IterateResult BufferStartCase::iterate (void)
309 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
310 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
311 int maxBindings = -1;
313 gl.enableLogging(true);
315 gl.glGetIntegerv(m_numBindingsTarget, &maxBindings);
316 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
319 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
321 for (int ndx = 0; ndx < maxBindings; ++ndx)
322 verifyStateIndexedInteger(result, gl, m_queryTarget, ndx, 0, m_verifierType);
327 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
328 glu::Buffer bufferA (m_context.getRenderContext());
329 glu::Buffer bufferB (m_context.getRenderContext());
331 const int ndxB = maxBindings / 2;
334 if (m_bufferTarget == GL_ATOMIC_COUNTER_BUFFER)
336 else if (m_bufferTarget == GL_SHADER_STORAGE_BUFFER)
338 gl.glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &offset);
339 GLU_EXPECT_NO_ERROR(gl.glGetError(), "get align");
344 TCU_CHECK(offset >= 0);
347 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Generic", "After setting generic binding point");
349 gl.glBindBuffer(m_bufferTarget, *bufferA);
350 gl.glBufferData(m_bufferTarget, 16, DE_NULL, GL_DYNAMIC_READ);
351 gl.glBindBuffer(m_bufferTarget, *bufferB);
352 gl.glBufferData(m_bufferTarget, 32, DE_NULL, GL_DYNAMIC_READ);
353 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen bufs");
355 verifyStateIndexedInteger(result, gl, m_queryTarget, 0, 0, m_verifierType);
358 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferBase");
360 gl.glBindBufferBase(m_bufferTarget, ndxA, *bufferA);
361 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind buf");
363 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, 0, m_verifierType);
366 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferRange");
368 gl.glBindBufferRange(m_bufferTarget, ndxB, *bufferB, offset, 8);
369 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind buf");
371 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxB, offset, m_verifierType);
375 const tcu::ScopedLogSection section(m_testCtx.getLog(), "DifferentStates", "Original state did not change");
377 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, 0, m_verifierType);
381 result.setTestContextResult(m_testCtx);
385 class BufferSizeCase : public TestCase
388 BufferSizeCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType);
391 IterateResult iterate (void);
393 const glw::GLenum m_queryTarget;
394 const glw::GLenum m_bufferTarget;
395 const glw::GLenum m_numBindingsTarget;
396 const QueryType m_verifierType;
399 BufferSizeCase::BufferSizeCase (Context& context, const char* name, const char* desc, glw::GLenum queryTarget, glw::GLenum bufferTarget, glw::GLenum numBindingsTarget, QueryType verifierType)
400 : TestCase (context, name, desc)
401 , m_queryTarget (queryTarget)
402 , m_bufferTarget (bufferTarget)
403 , m_numBindingsTarget (numBindingsTarget)
404 , m_verifierType (verifierType)
408 BufferSizeCase::IterateResult BufferSizeCase::iterate (void)
410 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
411 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
412 int maxBindings = -1;
414 gl.enableLogging(true);
416 gl.glGetIntegerv(m_numBindingsTarget, &maxBindings);
417 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
420 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
422 for (int ndx = 0; ndx < maxBindings; ++ndx)
423 verifyStateIndexedInteger(result, gl, m_queryTarget, ndx, 0, m_verifierType);
427 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
428 glu::Buffer bufferA (m_context.getRenderContext());
429 glu::Buffer bufferB (m_context.getRenderContext());
431 const int ndxB = maxBindings / 2;
434 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Generic", "After setting generic binding point");
436 gl.glBindBuffer(m_bufferTarget, *bufferA);
437 gl.glBufferData(m_bufferTarget, 16, DE_NULL, GL_DYNAMIC_READ);
438 gl.glBindBuffer(m_bufferTarget, *bufferB);
439 gl.glBufferData(m_bufferTarget, 32, DE_NULL, GL_DYNAMIC_READ);
440 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen bufs");
442 verifyStateIndexedInteger(result, gl, m_queryTarget, 0, 0, m_verifierType);
445 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferBase");
447 gl.glBindBufferBase(m_bufferTarget, ndxA, *bufferA);
448 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind buf");
450 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, 0, m_verifierType);
453 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Indexed", "After setting with glBindBufferRange");
455 gl.glBindBufferRange(m_bufferTarget, ndxB, *bufferB, 0, 8);
456 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind buf");
458 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxB, 8, m_verifierType);
462 const tcu::ScopedLogSection section(m_testCtx.getLog(), "DifferentStates", "Original state did not change");
464 verifyStateIndexedInteger(result, gl, m_queryTarget, ndxA, 0, m_verifierType);
468 result.setTestContextResult(m_testCtx);
472 class ImageBindingNameCase : public TestCase
475 ImageBindingNameCase (Context& context, const char* name, const char* desc, QueryType verifierType);
478 IterateResult iterate (void);
480 const QueryType m_verifierType;
483 ImageBindingNameCase::ImageBindingNameCase (Context& context, const char* name, const char* desc, QueryType verifierType)
484 : TestCase (context, name, desc)
485 , m_verifierType (verifierType)
489 ImageBindingNameCase::IterateResult ImageBindingNameCase::iterate (void)
491 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
492 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
495 gl.enableLogging(true);
497 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
498 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
501 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
503 for (int ndx = 0; ndx < maxImages; ++ndx)
504 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_NAME, ndx, 0, m_verifierType);
508 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
509 glu::Texture textureA (m_context.getRenderContext());
510 glu::Texture textureB (m_context.getRenderContext());
512 const int ndxB = maxImages / 2;
514 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
515 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
516 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
518 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
519 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
521 gl.glBindTexture(GL_TEXTURE_2D_ARRAY, *textureB);
522 gl.glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, 32, 32, 4);
523 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
525 gl.glBindImageTexture(ndxB, *textureB, 0, GL_FALSE, 2, GL_READ_ONLY, GL_RGBA8UI);
526 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
528 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_NAME, ndxA, *textureA, m_verifierType);
529 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_NAME, ndxB, *textureB, m_verifierType);
532 result.setTestContextResult(m_testCtx);
536 class ImageBindingLevelCase : public TestCase
539 ImageBindingLevelCase (Context& context, const char* name, const char* desc, QueryType verifierType);
542 IterateResult iterate (void);
544 const QueryType m_verifierType;
547 ImageBindingLevelCase::ImageBindingLevelCase (Context& context, const char* name, const char* desc, QueryType verifierType)
548 : TestCase (context, name, desc)
549 , m_verifierType (verifierType)
553 ImageBindingLevelCase::IterateResult ImageBindingLevelCase::iterate (void)
555 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
556 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
559 gl.enableLogging(true);
561 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
562 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
565 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
567 for (int ndx = 0; ndx < maxImages; ++ndx)
568 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LEVEL, ndx, 0, m_verifierType);
572 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
573 glu::Texture textureA (m_context.getRenderContext());
574 glu::Texture textureB (m_context.getRenderContext());
576 const int ndxB = maxImages / 2;
578 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
579 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
580 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
582 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
583 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
585 gl.glBindTexture(GL_TEXTURE_2D, *textureB);
586 gl.glTexStorage2D(GL_TEXTURE_2D, 3, GL_RGBA8, 32, 32);
587 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
589 gl.glBindImageTexture(ndxB, *textureB, 2, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
590 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
592 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LEVEL, ndxA, 0, m_verifierType);
593 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LEVEL, ndxB, 2, m_verifierType);
596 result.setTestContextResult(m_testCtx);
600 class ImageBindingLayeredCase : public TestCase
603 ImageBindingLayeredCase (Context& context, const char* name, const char* desc, QueryType verifierType);
606 IterateResult iterate (void);
608 const QueryType m_verifierType;
611 ImageBindingLayeredCase::ImageBindingLayeredCase (Context& context, const char* name, const char* desc, QueryType verifierType)
612 : TestCase (context, name, desc)
613 , m_verifierType (verifierType)
617 ImageBindingLayeredCase::IterateResult ImageBindingLayeredCase::iterate (void)
619 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
620 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
623 gl.enableLogging(true);
625 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
626 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
629 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
631 for (int ndx = 0; ndx < maxImages; ++ndx)
632 verifyStateIndexedBoolean(result, gl, GL_IMAGE_BINDING_LAYERED, ndx, false, m_verifierType);
636 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
637 glu::Texture textureA (m_context.getRenderContext());
638 glu::Texture textureB (m_context.getRenderContext());
640 const int ndxB = maxImages / 2;
642 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
643 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
644 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
646 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
647 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
649 gl.glBindTexture(GL_TEXTURE_2D_ARRAY, *textureB);
650 gl.glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, 32, 32, 4);
651 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
653 gl.glBindImageTexture(ndxB, *textureB, 0, GL_TRUE, 2, GL_READ_ONLY, GL_RGBA8UI);
654 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
656 verifyStateIndexedBoolean(result, gl, GL_IMAGE_BINDING_LAYERED, ndxA, false, m_verifierType);
657 verifyStateIndexedBoolean(result, gl, GL_IMAGE_BINDING_LAYERED, ndxB, true, m_verifierType);
660 result.setTestContextResult(m_testCtx);
664 class ImageBindingLayerCase : public TestCase
667 ImageBindingLayerCase (Context& context, const char* name, const char* desc, QueryType verifierType);
670 IterateResult iterate (void);
672 const QueryType m_verifierType;
675 ImageBindingLayerCase::ImageBindingLayerCase (Context& context, const char* name, const char* desc, QueryType verifierType)
676 : TestCase (context, name, desc)
677 , m_verifierType (verifierType)
681 ImageBindingLayerCase::IterateResult ImageBindingLayerCase::iterate (void)
683 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
684 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
687 gl.enableLogging(true);
689 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
690 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
693 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
695 for (int ndx = 0; ndx < maxImages; ++ndx)
696 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LAYER, ndx, 0, m_verifierType);
700 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
701 glu::Texture textureA (m_context.getRenderContext());
702 glu::Texture textureB (m_context.getRenderContext());
704 const int ndxB = maxImages / 2;
706 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
707 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
708 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
710 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
711 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
713 gl.glBindTexture(GL_TEXTURE_2D_ARRAY, *textureB);
714 gl.glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, 32, 32, 4);
715 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
717 gl.glBindImageTexture(ndxB, *textureB, 0, GL_TRUE, 2, GL_READ_ONLY, GL_RGBA8UI);
718 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
720 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LAYER, ndxA, 0, m_verifierType);
721 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_LAYER, ndxB, 2, m_verifierType);
724 result.setTestContextResult(m_testCtx);
728 class ImageBindingAccessCase : public TestCase
731 ImageBindingAccessCase (Context& context, const char* name, const char* desc, QueryType verifierType);
734 IterateResult iterate (void);
736 const QueryType m_verifierType;
739 ImageBindingAccessCase::ImageBindingAccessCase (Context& context, const char* name, const char* desc, QueryType verifierType)
740 : TestCase (context, name, desc)
741 , m_verifierType (verifierType)
745 ImageBindingAccessCase::IterateResult ImageBindingAccessCase::iterate (void)
747 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
748 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
751 gl.enableLogging(true);
753 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
754 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
757 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
759 for (int ndx = 0; ndx < maxImages; ++ndx)
760 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_ACCESS, ndx, GL_READ_ONLY, m_verifierType);
764 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
765 glu::Texture textureA (m_context.getRenderContext());
766 glu::Texture textureB (m_context.getRenderContext());
768 const int ndxB = maxImages / 2;
770 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
771 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
772 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
774 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
775 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
777 gl.glBindTexture(GL_TEXTURE_2D_ARRAY, *textureB);
778 gl.glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_RGBA8, 32, 32, 4);
779 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
781 gl.glBindImageTexture(ndxB, *textureB, 0, GL_TRUE, 2, GL_READ_WRITE, GL_RGBA8UI);
782 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
784 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_ACCESS, ndxA, GL_READ_ONLY, m_verifierType);
785 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_ACCESS, ndxB, GL_READ_WRITE, m_verifierType);
788 result.setTestContextResult(m_testCtx);
792 class ImageBindingFormatCase : public TestCase
795 ImageBindingFormatCase (Context& context, const char* name, const char* desc, QueryType verifierType);
798 IterateResult iterate (void);
800 const QueryType m_verifierType;
803 ImageBindingFormatCase::ImageBindingFormatCase (Context& context, const char* name, const char* desc, QueryType verifierType)
804 : TestCase (context, name, desc)
805 , m_verifierType (verifierType)
809 ImageBindingFormatCase::IterateResult ImageBindingFormatCase::iterate (void)
811 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
812 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
815 gl.enableLogging(true);
817 gl.glGetIntegerv(GL_MAX_IMAGE_UNITS, &maxImages);
818 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
821 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
823 for (int ndx = 0; ndx < maxImages; ++ndx)
824 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_FORMAT, ndx, GL_R32UI, m_verifierType);
828 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSetting", "After setting");
829 glu::Texture textureA (m_context.getRenderContext());
830 glu::Texture textureB (m_context.getRenderContext());
832 const int ndxB = maxImages / 2;
834 gl.glBindTexture(GL_TEXTURE_2D, *textureA);
835 gl.glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 32, 32);
836 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
838 gl.glBindImageTexture(ndxA, *textureA, 0, GL_FALSE, 0, GL_READ_ONLY, GL_RGBA8UI);
839 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
841 gl.glBindTexture(GL_TEXTURE_2D_ARRAY, *textureB);
842 gl.glTexStorage3D(GL_TEXTURE_2D_ARRAY, 1, GL_R32F, 32, 32, 4);
843 GLU_EXPECT_NO_ERROR(gl.glGetError(), "gen tex");
845 gl.glBindImageTexture(ndxB, *textureB, 0, GL_TRUE, 2, GL_READ_WRITE, GL_R32F);
846 GLU_EXPECT_NO_ERROR(gl.glGetError(), "bind unit");
848 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_FORMAT, ndxA, GL_RGBA8UI, m_verifierType);
849 verifyStateIndexedInteger(result, gl, GL_IMAGE_BINDING_FORMAT, ndxB, GL_R32F, m_verifierType);
852 result.setTestContextResult(m_testCtx);
856 class EnableBlendCase : public TestCase
859 EnableBlendCase (Context& context, const char* name, const char* desc, QueryType verifierType);
863 IterateResult iterate (void);
865 const QueryType m_verifierType;
868 EnableBlendCase::EnableBlendCase (Context& context, const char* name, const char* desc, QueryType verifierType)
869 : TestCase (context, name, desc)
870 , m_verifierType (verifierType)
874 void EnableBlendCase::init (void)
876 isExtensionSupported(m_context, "GL_EXT_draw_buffers_indexed");
879 EnableBlendCase::IterateResult EnableBlendCase::iterate (void)
881 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
882 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
883 deInt32 maxDrawBuffers = 0;
885 gl.enableLogging(true);
887 gl.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
888 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
891 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
893 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
894 verifyStateIndexedBoolean(result, gl, GL_BLEND, ndx, false, m_verifierType);
897 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSettingCommon", "After setting common");
899 gl.glEnable(GL_BLEND);
901 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
902 verifyStateIndexedBoolean(result, gl, GL_BLEND, ndx, true, m_verifierType);
906 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterSettingIndexed", "After setting indexed");
908 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
911 gl.glEnablei(GL_BLEND, ndx);
913 gl.glDisablei(GL_BLEND, ndx);
916 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
917 verifyStateIndexedBoolean(result, gl, GL_BLEND, ndx, (ndx % 2 == 0), m_verifierType);
920 const tcu::ScopedLogSection superSection (m_testCtx.getLog(), "AfterResettingIndexedWithCommon", "After resetting indexed with common");
922 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
925 gl.glEnablei(GL_BLEND, ndx);
927 gl.glDisablei(GL_BLEND, ndx);
930 gl.glEnable(GL_BLEND);
932 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
933 verifyStateIndexedBoolean(result, gl, GL_BLEND, ndx, true, m_verifierType);
936 result.setTestContextResult(m_testCtx);
940 class ColorMaskCase : public TestCase
943 ColorMaskCase (Context& context, const char* name, const char* desc, QueryType verifierType);
947 IterateResult iterate (void);
949 const QueryType m_verifierType;
952 ColorMaskCase::ColorMaskCase (Context& context, const char* name, const char* desc, QueryType verifierType)
953 : TestCase (context, name, desc)
954 , m_verifierType (verifierType)
958 void ColorMaskCase::init (void)
960 isExtensionSupported(m_context, "GL_EXT_draw_buffers_indexed");
963 ColorMaskCase::IterateResult ColorMaskCase::iterate (void)
965 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
966 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
967 deInt32 maxDrawBuffers = 0;
969 gl.enableLogging(true);
971 gl.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
972 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
975 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
977 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
978 verifyStateIndexedBooleanVec4(result, gl, GL_COLOR_WRITEMASK, ndx, tcu::BVec4(true), m_verifierType);
981 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommon", "After setting common");
983 gl.glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_FALSE);
985 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
986 verifyStateIndexedBooleanVec4(result, gl, GL_COLOR_WRITEMASK, ndx, tcu::BVec4(false, true, true, false), m_verifierType);
989 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexed", "After setting indexed");
991 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
992 gl.glColorMaski(ndx, (ndx % 2 == 0 ? GL_TRUE : GL_FALSE), (ndx % 2 == 1 ? GL_TRUE : GL_FALSE), (ndx % 2 == 0 ? GL_TRUE : GL_FALSE), (ndx % 2 == 1 ? GL_TRUE : GL_FALSE));
994 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
995 verifyStateIndexedBooleanVec4(result, gl, GL_COLOR_WRITEMASK, ndx, (ndx % 2 == 0 ? tcu::BVec4(true, false, true, false) : tcu::BVec4(false, true, false, true)), m_verifierType);
998 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommon", "After resetting indexed with common");
1000 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1001 gl.glColorMaski(ndx, (ndx % 2 == 0 ? GL_TRUE : GL_FALSE), (ndx % 2 == 1 ? GL_TRUE : GL_FALSE), (ndx % 2 == 0 ? GL_TRUE : GL_FALSE), (ndx % 2 == 1 ? GL_TRUE : GL_FALSE));
1003 gl.glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_FALSE);
1005 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1006 verifyStateIndexedBooleanVec4(result, gl, GL_COLOR_WRITEMASK, ndx, tcu::BVec4(false, true, true, false), m_verifierType);
1009 result.setTestContextResult(m_testCtx);
1013 class BlendFuncCase : public TestCase
1016 BlendFuncCase (Context& context, const char* name, const char* desc, QueryType verifierType);
1020 IterateResult iterate (void);
1022 const QueryType m_verifierType;
1025 BlendFuncCase::BlendFuncCase (Context& context, const char* name, const char* desc, QueryType verifierType)
1026 : TestCase (context, name, desc)
1027 , m_verifierType (verifierType)
1031 void BlendFuncCase::init (void)
1033 isExtensionSupported(m_context, "GL_EXT_draw_buffers_indexed");
1036 BlendFuncCase::IterateResult BlendFuncCase::iterate (void)
1038 const deUint32 blendFuncs[] =
1043 GL_ONE_MINUS_SRC_COLOR,
1045 GL_ONE_MINUS_DST_COLOR,
1047 GL_ONE_MINUS_SRC_ALPHA,
1049 GL_ONE_MINUS_DST_ALPHA,
1051 GL_ONE_MINUS_CONSTANT_COLOR,
1053 GL_ONE_MINUS_CONSTANT_ALPHA,
1054 GL_SRC_ALPHA_SATURATE
1057 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
1058 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
1059 deInt32 maxDrawBuffers = 0;
1061 gl.enableLogging(true);
1063 gl.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
1064 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
1067 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
1069 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1070 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, GL_ONE, m_verifierType);
1072 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1073 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, GL_ZERO, m_verifierType);
1075 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1076 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, GL_ONE, m_verifierType);
1078 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1079 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, GL_ZERO, m_verifierType);
1082 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommon", "After setting common");
1084 gl.glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
1086 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1087 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, GL_SRC_ALPHA, m_verifierType);
1089 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1090 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, GL_DST_ALPHA, m_verifierType);
1092 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1093 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, GL_SRC_ALPHA, m_verifierType);
1095 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1096 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, GL_DST_ALPHA, m_verifierType);
1099 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommonSeparate", "After setting common separate");
1101 gl.glBlendFuncSeparate(GL_SRC_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL_DST_COLOR, GL_ONE_MINUS_DST_ALPHA);
1103 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1104 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, GL_SRC_COLOR, m_verifierType);
1106 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1107 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, GL_ONE_MINUS_SRC_ALPHA, m_verifierType);
1109 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1110 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, GL_DST_COLOR, m_verifierType);
1112 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1113 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, GL_ONE_MINUS_DST_ALPHA, m_verifierType);
1116 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexed", "After setting indexed");
1118 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1119 gl.glBlendFunci(ndx, blendFuncs[ndx % DE_LENGTH_OF_ARRAY(blendFuncs)], blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)]);
1121 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1122 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, blendFuncs[ndx % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1124 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1125 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1127 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1128 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, blendFuncs[ndx % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1130 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1131 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1134 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexedSeparate", "After setting indexed separate");
1136 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1137 gl.glBlendFuncSeparatei(ndx, blendFuncs[(ndx + 3) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1138 blendFuncs[(ndx + 2) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1139 blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1140 blendFuncs[(ndx + 0) % DE_LENGTH_OF_ARRAY(blendFuncs)]);
1142 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1143 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, blendFuncs[(ndx + 3) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1145 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1146 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, blendFuncs[(ndx + 2) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1148 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1149 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1151 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1152 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, blendFuncs[(ndx + 0) % DE_LENGTH_OF_ARRAY(blendFuncs)], m_verifierType);
1156 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommon", "After resetting indexed with common");
1158 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1159 gl.glBlendFunci(ndx, blendFuncs[ndx % DE_LENGTH_OF_ARRAY(blendFuncs)], blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)]);
1161 gl.glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
1163 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1164 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, GL_SRC_ALPHA, m_verifierType);
1166 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1167 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, GL_DST_ALPHA, m_verifierType);
1169 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1170 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, GL_SRC_ALPHA, m_verifierType);
1172 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1173 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, GL_DST_ALPHA, m_verifierType);
1176 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommonSeparate", "After resetting indexed with common separate");
1178 gl.glBlendFuncSeparate(GL_SRC_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL_DST_COLOR, GL_ONE_MINUS_DST_ALPHA);
1180 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1181 gl.glBlendFuncSeparatei(ndx, blendFuncs[(ndx + 3) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1182 blendFuncs[(ndx + 2) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1183 blendFuncs[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendFuncs)],
1184 blendFuncs[(ndx + 0) % DE_LENGTH_OF_ARRAY(blendFuncs)]);
1186 gl.glBlendFuncSeparate(GL_SRC_COLOR, GL_ONE_MINUS_SRC_ALPHA, GL_DST_COLOR, GL_ONE_MINUS_DST_ALPHA);
1188 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1189 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_RGB, ndx, GL_SRC_COLOR, m_verifierType);
1191 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1192 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_RGB, ndx, GL_ONE_MINUS_SRC_ALPHA, m_verifierType);
1194 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1195 verifyStateIndexedInteger(result, gl, GL_BLEND_SRC_ALPHA, ndx, GL_DST_COLOR, m_verifierType);
1197 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1198 verifyStateIndexedInteger(result, gl, GL_BLEND_DST_ALPHA, ndx, GL_ONE_MINUS_DST_ALPHA, m_verifierType);
1201 result.setTestContextResult(m_testCtx);
1205 class BlendEquationCase : public TestCase
1208 BlendEquationCase (Context& context, const char* name, const char* desc, QueryType verifierType);
1212 IterateResult iterate (void);
1214 const QueryType m_verifierType;
1217 BlendEquationCase::BlendEquationCase (Context& context, const char* name, const char* desc, QueryType verifierType)
1218 : TestCase (context, name, desc)
1219 , m_verifierType (verifierType)
1223 void BlendEquationCase::init (void)
1225 isExtensionSupported(m_context, "GL_EXT_draw_buffers_indexed");
1228 BlendEquationCase::IterateResult BlendEquationCase::iterate (void)
1230 const deUint32 blendEquations[] =
1234 GL_FUNC_REVERSE_SUBTRACT,
1239 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
1240 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
1241 deInt32 maxDrawBuffers = 0;
1243 gl.enableLogging(true);
1245 gl.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
1246 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
1249 const tcu::ScopedLogSection section(m_testCtx.getLog(), "Initial", "Initial value");
1251 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1252 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_FUNC_ADD, m_verifierType);
1254 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1255 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_FUNC_ADD, m_verifierType);
1258 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommon", "After setting common");
1260 gl.glBlendEquation(GL_FUNC_SUBTRACT);
1262 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1263 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1265 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1266 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1269 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommonSeparate", "After setting common separate");
1271 gl.glBlendEquationSeparate(GL_FUNC_REVERSE_SUBTRACT, GL_FUNC_SUBTRACT);
1273 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1274 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_FUNC_REVERSE_SUBTRACT, m_verifierType);
1276 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1277 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1280 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexed", "After setting indexed");
1282 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1283 gl.glBlendEquationi(ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)]);
1285 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1286 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], m_verifierType);
1288 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1289 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], m_verifierType);
1292 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexedSeparate", "After setting indexed separate");
1294 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1295 gl.glBlendEquationSeparatei(ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], blendEquations[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendEquations)]);
1297 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1298 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], m_verifierType);
1300 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1301 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, blendEquations[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendEquations)], m_verifierType);
1304 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommon", "After resetting indexed with common");
1306 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1307 gl.glBlendEquationi(ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)]);
1309 gl.glBlendEquation(GL_FUNC_SUBTRACT);
1311 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1312 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1314 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1315 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1318 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommonSeparate", "After resetting indexed with common separate");
1320 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1321 gl.glBlendEquationSeparatei(ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], blendEquations[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendEquations)]);
1323 gl.glBlendEquationSeparate(GL_FUNC_REVERSE_SUBTRACT, GL_FUNC_SUBTRACT);
1325 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1326 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_FUNC_REVERSE_SUBTRACT, m_verifierType);
1328 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1329 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_FUNC_SUBTRACT, m_verifierType);
1332 result.setTestContextResult(m_testCtx);
1336 class BlendEquationAdvancedCase : public TestCase
1339 BlendEquationAdvancedCase (Context& context, const char* name, const char* desc, QueryType verifierType);
1343 IterateResult iterate (void);
1345 const QueryType m_verifierType;
1348 BlendEquationAdvancedCase::BlendEquationAdvancedCase (Context& context, const char* name, const char* desc, QueryType verifierType)
1349 : TestCase (context, name, desc)
1350 , m_verifierType (verifierType)
1354 void BlendEquationAdvancedCase::init (void)
1356 isExtensionSupported(m_context, "GL_EXT_draw_buffers_indexed");
1357 isExtensionSupported(m_context, "GL_KHR_blend_equation_advanced");
1360 BlendEquationAdvancedCase::IterateResult BlendEquationAdvancedCase::iterate (void)
1362 const deUint32 blendEquations[] =
1366 GL_FUNC_REVERSE_SUBTRACT,
1371 const deUint32 blendEquationAdvanced[] =
1390 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_testCtx.getLog());
1391 tcu::ResultCollector result (m_testCtx.getLog(), " // ERROR: ");
1392 deInt32 maxDrawBuffers = 0;
1394 gl.enableLogging(true);
1396 gl.glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
1397 GLU_EXPECT_NO_ERROR(gl.glGetError(), "glGetIntegerv");
1400 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingCommon", "After setting common");
1402 gl.glBlendEquation(GL_SCREEN);
1404 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1405 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_SCREEN, m_verifierType);
1407 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1408 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_SCREEN, m_verifierType);
1411 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterSettingIndexed", "After setting indexed");
1413 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1414 gl.glBlendEquationi(ndx, blendEquationAdvanced[ndx % DE_LENGTH_OF_ARRAY(blendEquationAdvanced)]);
1416 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1417 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, blendEquationAdvanced[ndx % DE_LENGTH_OF_ARRAY(blendEquationAdvanced)], m_verifierType);
1419 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1420 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, blendEquationAdvanced[ndx % DE_LENGTH_OF_ARRAY(blendEquationAdvanced)], m_verifierType);
1423 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedWithCommon", "After resetting indexed with common");
1425 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1426 gl.glBlendEquationi(ndx, blendEquationAdvanced[ndx % DE_LENGTH_OF_ARRAY(blendEquationAdvanced)]);
1428 gl.glBlendEquation(GL_MULTIPLY);
1430 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1431 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_MULTIPLY, m_verifierType);
1433 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1434 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_MULTIPLY, m_verifierType);
1437 const tcu::ScopedLogSection section (m_testCtx.getLog(), "AfterResettingIndexedSeparateWithCommon", "After resetting indexed separate with common");
1439 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1440 gl.glBlendEquationSeparatei(ndx, blendEquations[ndx % DE_LENGTH_OF_ARRAY(blendEquations)], blendEquations[(ndx + 1) % DE_LENGTH_OF_ARRAY(blendEquations)]);
1442 gl.glBlendEquation(GL_LIGHTEN);
1444 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1445 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_RGB, ndx, GL_LIGHTEN, m_verifierType);
1447 for (int ndx = 0; ndx < maxDrawBuffers; ++ndx)
1448 verifyStateIndexedInteger(result, gl, GL_BLEND_EQUATION_ALPHA, ndx, GL_LIGHTEN, m_verifierType);
1451 result.setTestContextResult(m_testCtx);
1457 IndexedStateQueryTests::IndexedStateQueryTests (Context& context)
1458 : TestCaseGroup(context, "indexed", "Indexed state queries")
1462 IndexedStateQueryTests::~IndexedStateQueryTests (void)
1466 void IndexedStateQueryTests::init (void)
1468 static const QueryType verifiers[] = { QUERY_INDEXED_BOOLEAN, QUERY_INDEXED_INTEGER, QUERY_INDEXED_INTEGER64 };
1469 static const QueryType vec4Verifiers[] = { QUERY_INDEXED_BOOLEAN_VEC4, QUERY_INDEXED_INTEGER_VEC4, QUERY_INDEXED_INTEGER64_VEC4 };
1471 #define FOR_EACH_VERIFIER(X) \
1472 for (int verifierNdx = 0; verifierNdx < DE_LENGTH_OF_ARRAY(verifiers); ++verifierNdx) \
1474 const QueryType verifier = verifiers[verifierNdx]; \
1475 const char* verifierSuffix = getVerifierSuffix(verifier); \
1476 this->addChild(X); \
1479 #define FOR_EACH_VEC4_VERIFIER(X) \
1480 for (int verifierNdx = 0; verifierNdx < DE_LENGTH_OF_ARRAY(vec4Verifiers); ++verifierNdx) \
1482 const QueryType verifier = vec4Verifiers[verifierNdx]; \
1483 const char* verifierSuffix = getVerifierSuffix(verifier); \
1484 this->addChild(X); \
1487 FOR_EACH_VERIFIER(new SampleMaskCase (m_context, (std::string() + "sample_mask_value_" + verifierSuffix).c_str(), "Test SAMPLE_MASK_VALUE", verifier))
1489 FOR_EACH_VERIFIER(new MinValueIndexed3Case (m_context, (std::string() + "max_compute_work_group_count_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_WORK_GROUP_COUNT", GL_MAX_COMPUTE_WORK_GROUP_COUNT, tcu::IVec3(65535,65535,65535), verifier))
1490 FOR_EACH_VERIFIER(new MinValueIndexed3Case (m_context, (std::string() + "max_compute_work_group_size_" + verifierSuffix).c_str(), "Test MAX_COMPUTE_WORK_GROUP_SIZE", GL_MAX_COMPUTE_WORK_GROUP_SIZE, tcu::IVec3(128, 128, 64), verifier))
1492 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, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, verifier))
1493 FOR_EACH_VERIFIER(new BufferStartCase (m_context, (std::string() + "atomic_counter_buffer_start_" + verifierSuffix).c_str(), "Test ATOMIC_COUNTER_BUFFER_START", GL_ATOMIC_COUNTER_BUFFER_START, GL_ATOMIC_COUNTER_BUFFER, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, verifier))
1494 FOR_EACH_VERIFIER(new BufferSizeCase (m_context, (std::string() + "atomic_counter_buffer_size_" + verifierSuffix).c_str(), "Test ATOMIC_COUNTER_BUFFER_SIZE", GL_ATOMIC_COUNTER_BUFFER_SIZE, GL_ATOMIC_COUNTER_BUFFER, GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, verifier))
1496 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, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, verifier))
1497 FOR_EACH_VERIFIER(new BufferStartCase (m_context, (std::string() + "shader_storage_buffer_start_" + verifierSuffix).c_str(), "Test SHADER_STORAGE_BUFFER_START", GL_SHADER_STORAGE_BUFFER_START, GL_SHADER_STORAGE_BUFFER, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, verifier))
1498 FOR_EACH_VERIFIER(new BufferSizeCase (m_context, (std::string() + "shader_storage_buffer_size_" + verifierSuffix).c_str(), "Test SHADER_STORAGE_BUFFER_SIZE", GL_SHADER_STORAGE_BUFFER_SIZE, GL_SHADER_STORAGE_BUFFER, GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, verifier))
1500 FOR_EACH_VERIFIER(new ImageBindingNameCase (m_context, (std::string() + "image_binding_name_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_NAME", verifier))
1501 FOR_EACH_VERIFIER(new ImageBindingLevelCase (m_context, (std::string() + "image_binding_level_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_LEVEL", verifier))
1502 FOR_EACH_VERIFIER(new ImageBindingLayeredCase (m_context, (std::string() + "image_binding_layered_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_LAYERED", verifier))
1503 FOR_EACH_VERIFIER(new ImageBindingLayerCase (m_context, (std::string() + "image_binding_layer_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_LAYER", verifier))
1504 FOR_EACH_VERIFIER(new ImageBindingAccessCase (m_context, (std::string() + "image_binding_access_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_ACCESS", verifier))
1505 FOR_EACH_VERIFIER(new ImageBindingFormatCase (m_context, (std::string() + "image_binding_format_" + verifierSuffix).c_str(), "Test IMAGE_BINDING_FORMAT", verifier))
1508 const QueryType verifier = QUERY_INDEXED_ISENABLED;
1509 const char* verifierSuffix = getVerifierSuffix(verifier);
1510 this->addChild(new EnableBlendCase (m_context, (std::string() + "blend_" + verifierSuffix).c_str(), "BLEND", verifier));
1512 FOR_EACH_VEC4_VERIFIER(new ColorMaskCase (m_context, (std::string() + "color_mask_" + verifierSuffix).c_str(), "COLOR_WRITEMASK", verifier))
1513 FOR_EACH_VERIFIER(new BlendFuncCase (m_context, (std::string() + "blend_func_" + verifierSuffix).c_str(), "BLEND_SRC and BLEND_DST", verifier))
1514 FOR_EACH_VERIFIER(new BlendEquationCase (m_context, (std::string() + "blend_equation_" + verifierSuffix).c_str(), "BLEND_EQUATION_RGB and BLEND_DST", verifier))
1515 FOR_EACH_VERIFIER(new BlendEquationAdvancedCase (m_context, (std::string() + "blend_equation_advanced_" + verifierSuffix).c_str(), "BLEND_EQUATION_RGB and BLEND_DST", verifier))
1517 #undef FOR_EACH_VEC4_VERIFIER
1518 #undef FOR_EACH_VERIFIER