1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 2.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 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 State Query tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es2fIntegerStateQueryTests.hpp"
25 #include "es2fApiCase.hpp"
27 #include "glsStateQueryUtil.hpp"
29 #include "gluRenderContext.hpp"
30 #include "gluContextInfo.hpp"
31 #include "gluStrUtil.hpp"
33 #include "tcuRenderTarget.hpp"
35 #include "deRandom.hpp"
37 #include "glwEnums.hpp"
39 using namespace glw; // GLint and other GL types
40 using deqp::gls::StateQueryUtil::StateQueryMemoryWriteGuard;
42 #ifndef GL_SLUMINANCE_NV
43 #define GL_SLUMINANCE_NV 0x8C46
45 #ifndef GL_SLUMINANCE_ALPHA_NV
46 #define GL_SLUMINANCE_ALPHA_NV 0x8C44
49 #define GL_BGR_NV 0x80E0
58 namespace IntegerStateQueryVerifiers
63 class StateVerifier : protected glu::CallLogWrapper
66 StateVerifier (const glw::Functions& gl, tcu::TestLog& log, const char* testNamePostfix);
67 virtual ~StateVerifier (); // make GCC happy
69 const char* getTestNamePostfix (void) const;
71 virtual void verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference) = DE_NULL;
72 virtual void verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3) = DE_NULL;
73 virtual void verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3) = DE_NULL;
74 virtual void verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference) = DE_NULL;
75 virtual void verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference) = DE_NULL;
76 virtual void verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1) = DE_NULL;
77 virtual void verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength) = DE_NULL;
78 virtual void verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits) = DE_NULL;
81 const char* const m_testNamePostfix;
84 StateVerifier::StateVerifier (const glw::Functions& gl, tcu::TestLog& log, const char* testNamePostfix)
85 : glu::CallLogWrapper (gl, log)
86 , m_testNamePostfix (testNamePostfix)
91 StateVerifier::~StateVerifier ()
95 const char* StateVerifier::getTestNamePostfix (void) const
97 return m_testNamePostfix;
100 // GetBooleanVerifier
102 class GetBooleanVerifier : public StateVerifier
105 GetBooleanVerifier (const glw::Functions& gl, tcu::TestLog& log);
106 void verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference);
107 void verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3);
108 void verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3);
109 void verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference);
110 void verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference);
111 void verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1);
112 void verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength);
113 void verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits);
116 GetBooleanVerifier::GetBooleanVerifier (const glw::Functions& gl, tcu::TestLog& log)
117 : StateVerifier(gl, log, "_getboolean")
121 void GetBooleanVerifier::verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference)
125 StateQueryMemoryWriteGuard<GLboolean> state;
126 glGetBooleanv(name, &state);
128 if (!state.verifyValidity(testCtx))
131 const GLboolean expectedGLState = reference ? GL_TRUE : GL_FALSE;
133 if (state != expectedGLState)
135 testCtx.getLog() << TestLog::Message << "// ERROR: expected " << (expectedGLState==GL_TRUE ? "GL_TRUE" : "GL_FALSE") << "; got " << (state == GL_TRUE ? "GL_TRUE" : (state == GL_FALSE ? "GL_FALSE" : "non-boolean")) << TestLog::EndMessage;
136 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
137 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
141 void GetBooleanVerifier::verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3)
143 verifyInteger4Mask(testCtx, name, reference0, true, reference1, true, reference2, true, reference3, true);
146 void GetBooleanVerifier::verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3)
150 StateQueryMemoryWriteGuard<GLboolean[4]> boolVector4;
151 glGetBooleanv(name, boolVector4);
153 if (!boolVector4.verifyValidity(testCtx))
156 const GLboolean referenceAsGLBoolean[] =
158 reference0 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE,
159 reference1 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE,
160 reference2 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE,
161 reference3 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE,
164 if ((enableRef0 && (boolVector4[0] != referenceAsGLBoolean[0])) ||
165 (enableRef1 && (boolVector4[1] != referenceAsGLBoolean[1])) ||
166 (enableRef2 && (boolVector4[2] != referenceAsGLBoolean[2])) ||
167 (enableRef3 && (boolVector4[3] != referenceAsGLBoolean[3])))
169 testCtx.getLog() << TestLog::Message << "// ERROR: expected "
170 << (enableRef0 ? (referenceAsGLBoolean[0] ? "GL_TRUE" : "GL_FALSE") : " - ") << ", "
171 << (enableRef1 ? (referenceAsGLBoolean[1] ? "GL_TRUE" : "GL_FALSE") : " - ") << ", "
172 << (enableRef2 ? (referenceAsGLBoolean[2] ? "GL_TRUE" : "GL_FALSE") : " - ") << ", "
173 << (enableRef3 ? (referenceAsGLBoolean[3] ? "GL_TRUE" : "GL_FALSE") : " - ") << TestLog::EndMessage;
175 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
176 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
180 void GetBooleanVerifier::verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference)
184 StateQueryMemoryWriteGuard<GLboolean> state;
185 glGetBooleanv(name, &state);
187 if (!state.verifyValidity(testCtx))
190 if (state == GL_TRUE) // state is non-zero, could be greater than reference (correct)
193 if (state == GL_FALSE) // state is zero
195 if (reference > 0) // and reference is greater than zero?
197 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE" << TestLog::EndMessage;
198 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
199 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
204 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE or GL_FALSE" << TestLog::EndMessage;
205 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
206 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
210 void GetBooleanVerifier::verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference)
214 StateQueryMemoryWriteGuard<GLboolean> state;
215 glGetBooleanv(name, &state);
217 if (!state.verifyValidity(testCtx))
220 if (state == GL_TRUE) // state is non-zero, could be greater than reference (correct)
223 if (state == GL_FALSE) // state is zero
225 if (reference > 0) // and reference is greater than zero?
227 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE" << TestLog::EndMessage;
228 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
229 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
234 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE or GL_FALSE" << TestLog::EndMessage;
235 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
236 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
240 void GetBooleanVerifier::verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1)
244 StateQueryMemoryWriteGuard<GLboolean[2]> boolVector;
245 glGetBooleanv(name, boolVector);
247 if (!boolVector.verifyValidity(testCtx))
250 const GLboolean referenceAsGLBoolean[2] =
252 reference0 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE,
253 reference1 ? (GLboolean)GL_TRUE : (GLboolean)GL_FALSE
256 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(referenceAsGLBoolean); ++ndx)
258 if (boolVector[ndx] == GL_TRUE) // state is non-zero, could be greater than any integer
262 else if (boolVector[ndx] == GL_FALSE) // state is zero
264 if (referenceAsGLBoolean[ndx] > 0) // and reference is greater than zero?
266 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE" << TestLog::EndMessage;
267 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
268 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
273 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE or GL_FALSE" << TestLog::EndMessage;
274 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
275 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
280 void GetBooleanVerifier::verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength)
284 StateQueryMemoryWriteGuard<GLboolean> state;
285 glGetBooleanv(name, &state);
287 if (!state.verifyValidity(testCtx))
290 for (size_t ndx = 0; ndx < referencesLength; ++ndx)
292 const GLboolean expectedGLState = references[ndx] ? GL_TRUE : GL_FALSE;
294 if (state == expectedGLState)
298 testCtx.getLog() << TestLog::Message << "// ERROR: got " << (state==GL_TRUE ? "GL_TRUE" : "GL_FALSE") << TestLog::EndMessage;
299 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
300 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
303 void GetBooleanVerifier::verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits)
305 // if stencilBits == 0, the mask is allowed to be either GL_TRUE or GL_FALSE
306 // otherwise it must be GL_TRUE
309 StateQueryMemoryWriteGuard<GLboolean> state;
310 glGetBooleanv(name, &state);
312 if (!state.verifyValidity(testCtx))
315 if (stencilBits > 0 && state != GL_TRUE)
317 testCtx.getLog() << TestLog::Message << "// ERROR: expected GL_TRUE" << TestLog::EndMessage;
318 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
319 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid boolean value");
325 class GetIntegerVerifier : public StateVerifier
328 GetIntegerVerifier (const glw::Functions& gl, tcu::TestLog& log);
329 void verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference);
330 void verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3);
331 void verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3);
332 void verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference);
333 void verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference);
334 void verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1);
335 void verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength);
336 void verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits);
339 GetIntegerVerifier::GetIntegerVerifier (const glw::Functions& gl, tcu::TestLog& log)
340 : StateVerifier(gl, log, "_getinteger")
344 void GetIntegerVerifier::verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference)
348 StateQueryMemoryWriteGuard<GLint> state;
349 glGetIntegerv(name, &state);
351 if (!state.verifyValidity(testCtx))
354 if (state != reference)
356 testCtx.getLog() << TestLog::Message << "// ERROR: expected " << reference << "; got " << state << TestLog::EndMessage;
357 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
358 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
362 void GetIntegerVerifier::verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3)
364 verifyInteger4Mask(testCtx, name, reference0, true, reference1, true, reference2, true, reference3, true);
367 void GetIntegerVerifier::verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3)
371 StateQueryMemoryWriteGuard<GLint[4]> intVector4;
372 glGetIntegerv(name, intVector4);
374 if (!intVector4.verifyValidity(testCtx))
377 if ((enableRef0 && (intVector4[0] != reference0)) ||
378 (enableRef1 && (intVector4[1] != reference1)) ||
379 (enableRef2 && (intVector4[2] != reference2)) ||
380 (enableRef3 && (intVector4[3] != reference3)))
382 testCtx.getLog() << TestLog::Message << "// ERROR: expected "
383 << (enableRef0?"":"(") << reference0 << (enableRef0?"":")") << ", "
384 << (enableRef1?"":"(") << reference1 << (enableRef1?"":")") << ", "
385 << (enableRef2?"":"(") << reference2 << (enableRef2?"":")") << ", "
386 << (enableRef3?"":"(") << reference3 << (enableRef3?"":")") << TestLog::EndMessage;
389 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
390 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
394 void GetIntegerVerifier::verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference)
398 StateQueryMemoryWriteGuard<GLint> state;
399 glGetIntegerv(name, &state);
401 if (!state.verifyValidity(testCtx))
404 if (state < reference)
406 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << reference << "; got " << state << TestLog::EndMessage;
407 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
408 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
412 void GetIntegerVerifier::verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference)
416 StateQueryMemoryWriteGuard<GLint> state;
417 glGetIntegerv(name, &state);
419 if (!state.verifyValidity(testCtx))
422 if (GLuint(state) < reference)
424 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << reference << "; got " << GLuint(state) << TestLog::EndMessage;
425 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
426 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
430 void GetIntegerVerifier::verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1)
434 StateQueryMemoryWriteGuard<GLint[2]> intVector2;
435 glGetIntegerv(name, intVector2);
437 if (!intVector2.verifyValidity(testCtx))
440 if (intVector2[0] < reference0 || intVector2[1] < reference1)
442 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << reference0 << ", " << reference1 << "; got " << intVector2[0] << ", " << intVector2[0] << TestLog::EndMessage;
443 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
444 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
448 void GetIntegerVerifier::verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength)
452 StateQueryMemoryWriteGuard<GLint> state;
453 glGetIntegerv(name, &state);
455 if (!state.verifyValidity(testCtx))
458 for (size_t ndx = 0; ndx < referencesLength; ++ndx)
460 const GLint expectedGLState = references[ndx];
462 if (state == expectedGLState)
466 testCtx.getLog() << TestLog::Message << "// ERROR: got " << state << TestLog::EndMessage;
467 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
468 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid integer value");
471 void GetIntegerVerifier::verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits)
475 StateQueryMemoryWriteGuard<GLint> state;
476 glGetIntegerv(name, &state);
478 if (!state.verifyValidity(testCtx))
481 const GLint reference = (1 << stencilBits) - 1;
483 if ((state & reference) != reference) // the least significant stencilBits bits should be on
485 testCtx.getLog() << TestLog::Message << "// ERROR: expected minimum mask of " << reference << "; got " << state << TestLog::EndMessage;
486 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
487 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid mask value");
493 class GetFloatVerifier : public StateVerifier
496 GetFloatVerifier (const glw::Functions& gl, tcu::TestLog& log);
497 void verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference);
498 void verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3);
499 void verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3);
500 void verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference);
501 void verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference);
502 void verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1);
503 void verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength);
504 void verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits);
507 GetFloatVerifier::GetFloatVerifier (const glw::Functions& gl, tcu::TestLog& log)
508 : StateVerifier(gl, log, "_getfloat")
512 void GetFloatVerifier::verifyInteger (tcu::TestContext& testCtx, GLenum name, GLint reference)
516 const GLfloat referenceAsFloat = GLfloat(reference);
517 DE_ASSERT(reference == GLint(referenceAsFloat)); // reference integer must have 1:1 mapping to float for this to work. Reference value is always such value in these tests
519 StateQueryMemoryWriteGuard<GLfloat> state;
520 glGetFloatv(name, &state);
522 if (!state.verifyValidity(testCtx))
525 if (state != referenceAsFloat)
527 testCtx.getLog() << TestLog::Message << "// ERROR: expected " << referenceAsFloat << "; got " << state << TestLog::EndMessage;
528 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
529 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
533 void GetFloatVerifier::verifyInteger4 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1, GLint reference2, GLint reference3)
535 verifyInteger4Mask(testCtx, name, reference0, true, reference1, true, reference2, true, reference3, true);
538 void GetFloatVerifier::verifyInteger4Mask (tcu::TestContext& testCtx, GLenum name, GLint reference0, bool enableRef0, GLint reference1, bool enableRef1, GLint reference2, bool enableRef2, GLint reference3, bool enableRef3)
542 StateQueryMemoryWriteGuard<GLfloat[4]> floatVector4;
543 glGetFloatv(name, floatVector4);
545 if (!floatVector4.verifyValidity(testCtx))
548 if ((enableRef0 && (floatVector4[0] != GLfloat(reference0))) ||
549 (enableRef1 && (floatVector4[1] != GLfloat(reference1))) ||
550 (enableRef2 && (floatVector4[2] != GLfloat(reference2))) ||
551 (enableRef3 && (floatVector4[3] != GLfloat(reference3))))
553 testCtx.getLog() << TestLog::Message << "// ERROR: expected "
554 << (enableRef0?"":"(") << GLfloat(reference0) << (enableRef0?"":")") << ", "
555 << (enableRef1?"":"(") << GLfloat(reference1) << (enableRef1?"":")") << ", "
556 << (enableRef2?"":"(") << GLfloat(reference2) << (enableRef2?"":")") << ", "
557 << (enableRef3?"":"(") << GLfloat(reference3) << (enableRef3?"":")") << TestLog::EndMessage;
559 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
560 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
564 void GetFloatVerifier::verifyIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLint reference)
568 StateQueryMemoryWriteGuard<GLfloat> state;
569 glGetFloatv(name, &state);
571 if (!state.verifyValidity(testCtx))
574 if (state < GLfloat(reference))
576 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << GLfloat(reference) << "; got " << state << TestLog::EndMessage;
577 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
578 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
582 void GetFloatVerifier::verifyUnsignedIntegerGreaterOrEqual (tcu::TestContext& testCtx, GLenum name, GLuint reference)
586 StateQueryMemoryWriteGuard<GLfloat> state;
587 glGetFloatv(name, &state);
589 if (!state.verifyValidity(testCtx))
592 if (state < GLfloat(reference))
594 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << GLfloat(reference) << "; got " << state << TestLog::EndMessage;
595 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
596 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
600 void GetFloatVerifier::verifyIntegerGreaterOrEqual2 (tcu::TestContext& testCtx, GLenum name, GLint reference0, GLint reference1)
604 StateQueryMemoryWriteGuard<GLfloat[2]> floatVector2;
605 glGetFloatv(name, floatVector2);
607 if (!floatVector2.verifyValidity(testCtx))
610 if (floatVector2[0] < GLfloat(reference0) || floatVector2[1] < GLfloat(reference1))
612 testCtx.getLog() << TestLog::Message << "// ERROR: expected greater or equal to " << GLfloat(reference0) << ", " << GLfloat(reference1) << "; got " << floatVector2[0] << ", " << floatVector2[1] << TestLog::EndMessage;
613 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
614 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
618 void GetFloatVerifier::verifyIntegerAnyOf (tcu::TestContext& testCtx, GLenum name, const GLint references[], size_t referencesLength)
622 StateQueryMemoryWriteGuard<GLfloat> state;
623 glGetFloatv(name, &state);
625 if (!state.verifyValidity(testCtx))
628 for (size_t ndx = 0; ndx < referencesLength; ++ndx)
630 const GLfloat expectedGLState = GLfloat(references[ndx]);
631 DE_ASSERT(references[ndx] == GLint(expectedGLState)); // reference integer must have 1:1 mapping to float for this to work. Reference value is always such value in these tests
633 if (state == expectedGLState)
637 testCtx.getLog() << TestLog::Message << "// ERROR: got " << state << TestLog::EndMessage;
638 if (testCtx.getTestResult() == QP_TEST_RESULT_PASS)
639 testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid float value");
642 void GetFloatVerifier::verifyStencilMaskInitial (tcu::TestContext& testCtx, GLenum name, int stencilBits)
644 // checking the mask bits with float doesn't make much sense because of conversion errors
645 // just verify that the value is greater or equal to the minimum value
646 const GLint reference = (1 << stencilBits) - 1;
647 verifyIntegerGreaterOrEqual(testCtx, name, reference);
650 } // IntegerStateQueryVerifiers
655 using namespace IntegerStateQueryVerifiers;
656 using namespace deqp::gls::StateQueryUtil;
658 class ConstantMinimumValueTestCase : public ApiCase
661 ConstantMinimumValueTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum targetName, GLint minValue)
662 : ApiCase (context, name, description)
663 , m_targetName (targetName)
664 , m_minValue (minValue)
665 , m_verifier (verifier)
671 m_verifier->verifyUnsignedIntegerGreaterOrEqual(m_testCtx, m_targetName, m_minValue);
672 expectError(GL_NO_ERROR);
678 StateVerifier* m_verifier;
681 class SampleBuffersTestCase : public ApiCase
684 SampleBuffersTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
685 : ApiCase (context, name, description)
686 , m_verifier (verifier)
692 const int expectedSampleBuffers = (m_context.getRenderTarget().getNumSamples() > 1) ? 1 : 0;
694 m_log << tcu::TestLog::Message << "Sample count is " << (m_context.getRenderTarget().getNumSamples()) << ", expecting GL_SAMPLE_BUFFERS to be " << expectedSampleBuffers << tcu::TestLog::EndMessage;
696 m_verifier->verifyInteger(m_testCtx, GL_SAMPLE_BUFFERS, expectedSampleBuffers);
697 expectError(GL_NO_ERROR);
701 StateVerifier* m_verifier;
704 class SamplesTestCase : public ApiCase
707 SamplesTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
708 : ApiCase (context, name, description)
709 , m_verifier (verifier)
716 if (m_context.getRenderTarget().getNumSamples() > 1)
718 m_log << tcu::TestLog::Message << "Sample count is " << (m_context.getRenderTarget().getNumSamples()) << tcu::TestLog::EndMessage;
720 m_verifier->verifyInteger(m_testCtx, GL_SAMPLES, m_context.getRenderTarget().getNumSamples());
721 expectError(GL_NO_ERROR);
725 const glw::GLint validSamples[] = {0, 1};
727 m_log << tcu::TestLog::Message << "Expecting GL_SAMPLES to be 0 or 1" << tcu::TestLog::EndMessage;
729 m_verifier->verifyIntegerAnyOf(m_testCtx, GL_SAMPLES, validSamples, DE_LENGTH_OF_ARRAY(validSamples));
730 expectError(GL_NO_ERROR);
735 StateVerifier* m_verifier;
738 class HintTestCase : public ApiCase
741 HintTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum targetName)
742 : ApiCase (context, name, description)
743 , m_targetName (targetName)
744 , m_verifier (verifier)
750 m_verifier->verifyInteger(m_testCtx, m_targetName, GL_DONT_CARE);
751 expectError(GL_NO_ERROR);
753 glHint(m_targetName, GL_NICEST);
754 m_verifier->verifyInteger(m_testCtx, m_targetName, GL_NICEST);
755 expectError(GL_NO_ERROR);
757 glHint(m_targetName, GL_FASTEST);
758 m_verifier->verifyInteger(m_testCtx, m_targetName, GL_FASTEST);
759 expectError(GL_NO_ERROR);
761 glHint(m_targetName, GL_DONT_CARE);
762 m_verifier->verifyInteger(m_testCtx, m_targetName, GL_DONT_CARE);
763 expectError(GL_NO_ERROR);
768 StateVerifier* m_verifier;
771 class DepthFuncTestCase : public ApiCase
774 DepthFuncTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
775 : ApiCase (context, name, description)
776 , m_verifier (verifier)
782 m_verifier->verifyInteger(m_testCtx, GL_DEPTH_FUNC, GL_LESS);
783 expectError(GL_NO_ERROR);
785 const GLenum depthFunctions[] = {GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GREATER, GL_GEQUAL, GL_NOTEQUAL};
786 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(depthFunctions); ndx++)
788 glDepthFunc(depthFunctions[ndx]);
789 expectError(GL_NO_ERROR);
791 m_verifier->verifyInteger(m_testCtx, GL_DEPTH_FUNC, depthFunctions[ndx]);
792 expectError(GL_NO_ERROR);
797 StateVerifier* m_verifier;
800 class CullFaceTestCase : public ApiCase
803 CullFaceTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
804 : ApiCase (context, name, description)
805 , m_verifier (verifier)
811 m_verifier->verifyInteger(m_testCtx, GL_CULL_FACE_MODE, GL_BACK);
812 expectError(GL_NO_ERROR);
814 const GLenum cullFaces[] = {GL_FRONT, GL_BACK, GL_FRONT_AND_BACK};
815 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(cullFaces); ndx++)
817 glCullFace(cullFaces[ndx]);
818 expectError(GL_NO_ERROR);
820 m_verifier->verifyInteger(m_testCtx, GL_CULL_FACE_MODE, cullFaces[ndx]);
821 expectError(GL_NO_ERROR);
826 StateVerifier* m_verifier;
829 class FrontFaceTestCase : public ApiCase
832 FrontFaceTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
833 : ApiCase (context, name, description)
834 , m_verifier (verifier)
840 m_verifier->verifyInteger(m_testCtx, GL_FRONT_FACE, GL_CCW);
841 expectError(GL_NO_ERROR);
843 const GLenum frontFaces[] = {GL_CW, GL_CCW};
844 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(frontFaces); ndx++)
846 glFrontFace(frontFaces[ndx]);
847 expectError(GL_NO_ERROR);
849 m_verifier->verifyInteger(m_testCtx, GL_FRONT_FACE, frontFaces[ndx]);
850 expectError(GL_NO_ERROR);
855 StateVerifier* m_verifier;
858 class ViewPortTestCase : public ApiCase
861 ViewPortTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
862 : ApiCase (context, name, description)
863 , m_verifier (verifier)
869 de::Random rnd(0xabcdef);
871 GLint maxViewportDimensions[2] = {0};
872 GLfloat viewportBoundsRange[2] = {0.0f};
873 GLboolean hasViewportArray = false;
874 glGetIntegerv(GL_MAX_VIEWPORT_DIMS, maxViewportDimensions);
875 hasViewportArray = m_context.getContextInfo().isExtensionSupported("GL_OES_viewport_array") ||
876 m_context.getContextInfo().isExtensionSupported("GL_NV_viewport_array");
877 if (hasViewportArray)
879 glGetFloatv(GL_VIEWPORT_BOUNDS_RANGE, viewportBoundsRange);
882 // verify initial value of first two values
883 m_verifier->verifyInteger4(m_testCtx, GL_VIEWPORT, 0, 0, m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
884 expectError(GL_NO_ERROR);
886 const int numIterations = 120;
887 for (int i = 0; i < numIterations; ++i)
889 GLint x = rnd.getInt(-64000, 64000);
890 GLint y = rnd.getInt(-64000, 64000);
891 GLsizei width = rnd.getInt(0, maxViewportDimensions[0]);
892 GLsizei height = rnd.getInt(0, maxViewportDimensions[1]);
894 glViewport(x, y, width, height);
896 if (hasViewportArray)
898 m_verifier->verifyInteger4(m_testCtx, GL_VIEWPORT,
899 de::clamp(x, deFloorFloatToInt32(viewportBoundsRange[0]), deFloorFloatToInt32(viewportBoundsRange[1])),
900 de::clamp(y, deFloorFloatToInt32(viewportBoundsRange[0]), deFloorFloatToInt32(viewportBoundsRange[1])),
905 m_verifier->verifyInteger4(m_testCtx, GL_VIEWPORT, x, y, width, height);
908 expectError(GL_NO_ERROR);
913 StateVerifier* m_verifier;
916 class ScissorBoxTestCase : public ApiCase
919 ScissorBoxTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
920 : ApiCase (context, name, description)
921 , m_verifier (verifier)
927 de::Random rnd(0xabcdef);
929 // verify initial value
930 m_verifier->verifyInteger4(m_testCtx, GL_SCISSOR_BOX, 0, 0, m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
931 expectError(GL_NO_ERROR);
933 const int numIterations = 120;
934 for (int i = 0; i < numIterations; ++i)
936 GLint left = rnd.getInt(-64000, 64000);
937 GLint bottom = rnd.getInt(-64000, 64000);
938 GLsizei width = rnd.getInt(0, 64000);
939 GLsizei height = rnd.getInt(0, 64000);
941 glScissor(left, bottom, width, height);
942 m_verifier->verifyInteger4(m_testCtx, GL_SCISSOR_BOX, left, bottom, width, height);
943 expectError(GL_NO_ERROR);
947 StateVerifier* m_verifier;
950 class MaxViewportDimsTestCase : public ApiCase
953 MaxViewportDimsTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
954 : ApiCase (context, name, description)
955 , m_verifier (verifier)
961 m_verifier->verifyIntegerGreaterOrEqual2(m_testCtx, GL_MAX_VIEWPORT_DIMS, m_context.getRenderTarget().getWidth(), m_context.getRenderTarget().getHeight());
962 expectError(GL_NO_ERROR);
965 StateVerifier* m_verifier;
968 class StencilRefTestCase : public ApiCase
971 StencilRefTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName)
972 : ApiCase (context, name, description)
973 , m_verifier (verifier)
974 , m_testTargetName (testTargetName)
980 m_verifier->verifyInteger(m_testCtx, m_testTargetName, 0);
981 expectError(GL_NO_ERROR);
983 const int stencilBits = m_context.getRenderTarget().getStencilBits();
985 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
987 const int ref = 1 << stencilBit;
989 glStencilFunc(GL_ALWAYS, ref, 0); // mask should not affect the REF
990 expectError(GL_NO_ERROR);
992 m_verifier->verifyInteger(m_testCtx, m_testTargetName, ref);
993 expectError(GL_NO_ERROR);
995 glStencilFunc(GL_ALWAYS, ref, ref);
996 expectError(GL_NO_ERROR);
998 m_verifier->verifyInteger(m_testCtx, m_testTargetName, ref);
999 expectError(GL_NO_ERROR);
1004 StateVerifier* m_verifier;
1005 GLenum m_testTargetName;
1008 class StencilRefSeparateTestCase : public ApiCase
1011 StencilRefSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, GLenum stencilFuncTargetFace)
1012 : ApiCase (context, name, description)
1013 , m_verifier (verifier)
1014 , m_testTargetName (testTargetName)
1015 , m_stencilFuncTargetFace (stencilFuncTargetFace)
1021 m_verifier->verifyInteger(m_testCtx, m_testTargetName, 0);
1022 expectError(GL_NO_ERROR);
1024 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1026 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1028 const int ref = 1 << stencilBit;
1030 glStencilFuncSeparate(m_stencilFuncTargetFace, GL_ALWAYS, ref, 0);
1031 expectError(GL_NO_ERROR);
1033 m_verifier->verifyInteger(m_testCtx, m_testTargetName, ref);
1034 expectError(GL_NO_ERROR);
1036 glStencilFuncSeparate(m_stencilFuncTargetFace, GL_ALWAYS, ref, ref);
1037 expectError(GL_NO_ERROR);
1039 m_verifier->verifyInteger(m_testCtx, m_testTargetName, ref);
1040 expectError(GL_NO_ERROR);
1044 StateVerifier* m_verifier;
1045 GLenum m_testTargetName;
1046 GLenum m_stencilFuncTargetFace;
1049 class StencilOpTestCase : public ApiCase
1052 StencilOpTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum stencilOpName)
1053 : ApiCase (context, name, description)
1054 , m_verifier (verifier)
1055 , m_stencilOpName (stencilOpName)
1061 m_verifier->verifyInteger(m_testCtx, m_stencilOpName, GL_KEEP);
1062 expectError(GL_NO_ERROR);
1064 const GLenum stencilOpValues[] = {GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT, GL_INCR_WRAP, GL_DECR_WRAP};
1066 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(stencilOpValues); ++ndx)
1068 SetStencilOp(stencilOpValues[ndx]);
1069 expectError(GL_NO_ERROR);
1071 m_verifier->verifyInteger(m_testCtx, m_stencilOpName, stencilOpValues[ndx]);
1072 expectError(GL_NO_ERROR);
1077 virtual void SetStencilOp (GLenum stencilOpValue)
1079 switch (m_stencilOpName)
1081 case GL_STENCIL_FAIL:
1082 case GL_STENCIL_BACK_FAIL:
1083 glStencilOp(stencilOpValue, GL_KEEP, GL_KEEP);
1086 case GL_STENCIL_PASS_DEPTH_FAIL:
1087 case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
1088 glStencilOp(GL_KEEP, stencilOpValue, GL_KEEP);
1091 case GL_STENCIL_PASS_DEPTH_PASS:
1092 case GL_STENCIL_BACK_PASS_DEPTH_PASS:
1093 glStencilOp(GL_KEEP, GL_KEEP, stencilOpValue);
1097 DE_ASSERT(false && "should not happen");
1102 StateVerifier* m_verifier;
1103 GLenum m_stencilOpName;
1106 class StencilOpSeparateTestCase : public StencilOpTestCase
1109 StencilOpSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum stencilOpName, GLenum stencilOpFace)
1110 : StencilOpTestCase (context, verifier, name, description, stencilOpName)
1111 , m_stencilOpFace (stencilOpFace)
1116 void SetStencilOp (GLenum stencilOpValue)
1118 switch (m_stencilOpName)
1120 case GL_STENCIL_FAIL:
1121 case GL_STENCIL_BACK_FAIL:
1122 glStencilOpSeparate(m_stencilOpFace, stencilOpValue, GL_KEEP, GL_KEEP);
1125 case GL_STENCIL_PASS_DEPTH_FAIL:
1126 case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
1127 glStencilOpSeparate(m_stencilOpFace, GL_KEEP, stencilOpValue, GL_KEEP);
1130 case GL_STENCIL_PASS_DEPTH_PASS:
1131 case GL_STENCIL_BACK_PASS_DEPTH_PASS:
1132 glStencilOpSeparate(m_stencilOpFace, GL_KEEP, GL_KEEP, stencilOpValue);
1136 DE_ASSERT(false && "should not happen");
1141 GLenum m_stencilOpFace;
1144 class StencilFuncTestCase : public ApiCase
1147 StencilFuncTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
1148 : ApiCase (context, name, description)
1149 , m_verifier (verifier)
1155 m_verifier->verifyInteger(m_testCtx, GL_STENCIL_FUNC, GL_ALWAYS);
1156 expectError(GL_NO_ERROR);
1158 const GLenum stencilfuncValues[] = {GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL};
1160 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(stencilfuncValues); ++ndx)
1162 glStencilFunc(stencilfuncValues[ndx], 0, 0);
1163 expectError(GL_NO_ERROR);
1165 m_verifier->verifyInteger(m_testCtx, GL_STENCIL_FUNC, stencilfuncValues[ndx]);
1166 expectError(GL_NO_ERROR);
1168 m_verifier->verifyInteger(m_testCtx, GL_STENCIL_BACK_FUNC, stencilfuncValues[ndx]);
1169 expectError(GL_NO_ERROR);
1173 StateVerifier* m_verifier;
1176 class StencilFuncSeparateTestCase : public ApiCase
1179 StencilFuncSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum stencilFuncName, GLenum stencilFuncFace)
1180 : ApiCase (context, name, description)
1181 , m_verifier (verifier)
1182 , m_stencilFuncName (stencilFuncName)
1183 , m_stencilFuncFace (stencilFuncFace)
1189 m_verifier->verifyInteger(m_testCtx, m_stencilFuncName, GL_ALWAYS);
1190 expectError(GL_NO_ERROR);
1192 const GLenum stencilfuncValues[] = {GL_NEVER, GL_ALWAYS, GL_LESS, GL_LEQUAL, GL_EQUAL, GL_GEQUAL, GL_GREATER, GL_NOTEQUAL};
1194 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(stencilfuncValues); ++ndx)
1196 glStencilFuncSeparate(m_stencilFuncFace, stencilfuncValues[ndx], 0, 0);
1197 expectError(GL_NO_ERROR);
1199 m_verifier->verifyInteger(m_testCtx, m_stencilFuncName, stencilfuncValues[ndx]);
1200 expectError(GL_NO_ERROR);
1204 StateVerifier* m_verifier;
1205 GLenum m_stencilFuncName;
1206 GLenum m_stencilFuncFace;
1209 class StencilMaskTestCase : public ApiCase
1212 StencilMaskTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName)
1213 : ApiCase (context, name, description)
1214 , m_verifier (verifier)
1215 , m_testTargetName (testTargetName)
1221 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1223 m_verifier->verifyStencilMaskInitial(m_testCtx, m_testTargetName, stencilBits);
1224 expectError(GL_NO_ERROR);
1226 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1228 const int mask = 1 << stencilBit;
1230 glStencilFunc(GL_ALWAYS, 0, mask);
1231 expectError(GL_NO_ERROR);
1233 m_verifier->verifyInteger(m_testCtx, m_testTargetName, mask);
1234 expectError(GL_NO_ERROR);
1238 StateVerifier* m_verifier;
1239 GLenum m_testTargetName;
1242 class StencilMaskSeparateTestCase : public ApiCase
1245 StencilMaskSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, GLenum stencilFuncTargetFace)
1246 : ApiCase (context, name, description)
1247 , m_verifier (verifier)
1248 , m_testTargetName (testTargetName)
1249 , m_stencilFuncTargetFace (stencilFuncTargetFace)
1255 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1257 m_verifier->verifyStencilMaskInitial(m_testCtx, m_testTargetName, stencilBits);
1258 expectError(GL_NO_ERROR);
1260 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1262 const int mask = 1 << stencilBit;
1264 glStencilFuncSeparate(m_stencilFuncTargetFace, GL_ALWAYS, 0, mask);
1265 expectError(GL_NO_ERROR);
1267 m_verifier->verifyInteger(m_testCtx, m_testTargetName, mask);
1268 expectError(GL_NO_ERROR);
1272 StateVerifier* m_verifier;
1273 GLenum m_testTargetName;
1274 GLenum m_stencilFuncTargetFace;
1277 class StencilWriteMaskTestCase : public ApiCase
1280 StencilWriteMaskTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName)
1281 : ApiCase (context, name, description)
1282 , m_verifier (verifier)
1283 , m_testTargetName (testTargetName)
1289 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1291 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1293 const int mask = 1 << stencilBit;
1295 glStencilMask(mask);
1296 expectError(GL_NO_ERROR);
1298 m_verifier->verifyInteger(m_testCtx, m_testTargetName, mask);
1299 expectError(GL_NO_ERROR);
1303 StateVerifier* m_verifier;
1304 GLenum m_testTargetName;
1307 class StencilWriteMaskSeparateTestCase : public ApiCase
1310 StencilWriteMaskSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, GLenum stencilTargetFace)
1311 : ApiCase (context, name, description)
1312 , m_verifier (verifier)
1313 , m_testTargetName (testTargetName)
1314 , m_stencilTargetFace (stencilTargetFace)
1320 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1322 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1324 const int mask = 1 << stencilBit;
1326 glStencilMaskSeparate(m_stencilTargetFace, mask);
1327 expectError(GL_NO_ERROR);
1329 m_verifier->verifyInteger(m_testCtx, m_testTargetName, mask);
1330 expectError(GL_NO_ERROR);
1334 StateVerifier* m_verifier;
1335 GLenum m_testTargetName;
1336 GLenum m_stencilTargetFace;
1339 class PixelStoreAlignTestCase : public ApiCase
1342 PixelStoreAlignTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName)
1343 : ApiCase (context, name, description)
1344 , m_verifier (verifier)
1345 , m_testTargetName (testTargetName)
1351 m_verifier->verifyInteger(m_testCtx, m_testTargetName, 4);
1352 expectError(GL_NO_ERROR);
1354 const int alignments[] = {1, 2, 4, 8};
1356 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(alignments); ++ndx)
1358 const int referenceValue = alignments[ndx];
1360 glPixelStorei(m_testTargetName, referenceValue);
1361 expectError(GL_NO_ERROR);
1363 m_verifier->verifyInteger(m_testCtx, m_testTargetName, referenceValue);
1364 expectError(GL_NO_ERROR);
1369 StateVerifier* m_verifier;
1370 GLenum m_testTargetName;
1373 class BlendFuncTestCase : public ApiCase
1376 BlendFuncTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, int initialValue)
1377 : ApiCase (context, name, description)
1378 , m_verifier (verifier)
1379 , m_testTargetName (testTargetName)
1380 , m_initialValue (initialValue)
1386 m_verifier->verifyInteger(m_testCtx, m_testTargetName, m_initialValue);
1387 expectError(GL_NO_ERROR);
1389 const GLenum blendFuncValues[] =
1391 GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR,
1392 GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR,
1393 GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA,
1394 GL_SRC_ALPHA_SATURATE
1397 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(blendFuncValues); ++ndx)
1399 const GLenum referenceValue = blendFuncValues[ndx];
1401 //GL_SRC_ALPHA_SATURATE is ony allowed for srcRGB or srcA
1402 if (referenceValue == GL_SRC_ALPHA_SATURATE &&
1403 !(m_testTargetName == GL_BLEND_SRC_RGB || m_testTargetName == GL_BLEND_SRC_ALPHA))
1406 SetBlendFunc(referenceValue);
1407 expectError(GL_NO_ERROR);
1409 m_verifier->verifyInteger(m_testCtx, m_testTargetName, referenceValue);
1410 expectError(GL_NO_ERROR);
1414 virtual void SetBlendFunc (GLenum func)
1416 switch (m_testTargetName)
1418 case GL_BLEND_SRC_RGB:
1419 case GL_BLEND_SRC_ALPHA:
1420 glBlendFunc(func, GL_ZERO);
1423 case GL_BLEND_DST_RGB:
1424 case GL_BLEND_DST_ALPHA:
1425 glBlendFunc(GL_ZERO, func);
1429 DE_ASSERT(false && "should not happen");
1434 StateVerifier* m_verifier;
1435 GLenum m_testTargetName;
1439 class BlendFuncSeparateTestCase : public BlendFuncTestCase
1442 BlendFuncSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, int initialValue)
1443 : BlendFuncTestCase (context, verifier, name, description, testTargetName, initialValue)
1447 void SetBlendFunc (GLenum func)
1449 switch (m_testTargetName)
1451 case GL_BLEND_SRC_RGB:
1452 glBlendFuncSeparate(func, GL_ZERO, GL_ZERO, GL_ZERO);
1455 case GL_BLEND_DST_RGB:
1456 glBlendFuncSeparate(GL_ZERO, func, GL_ZERO, GL_ZERO);
1459 case GL_BLEND_SRC_ALPHA:
1460 glBlendFuncSeparate(GL_ZERO, GL_ZERO, func, GL_ZERO);
1463 case GL_BLEND_DST_ALPHA:
1464 glBlendFuncSeparate(GL_ZERO, GL_ZERO, GL_ZERO, func);
1468 DE_ASSERT(false && "should not happen");
1474 class BlendEquationTestCase : public ApiCase
1477 BlendEquationTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, int initialValue)
1478 : ApiCase (context, name, description)
1479 , m_verifier (verifier)
1480 , m_testTargetName (testTargetName)
1481 , m_initialValue (initialValue)
1487 m_verifier->verifyInteger(m_testCtx, m_testTargetName, m_initialValue);
1488 expectError(GL_NO_ERROR);
1490 const GLenum blendFuncValues[] =
1492 GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT
1495 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(blendFuncValues); ++ndx)
1497 const GLenum referenceValue = blendFuncValues[ndx];
1499 SetBlendEquation(referenceValue);
1500 expectError(GL_NO_ERROR);
1502 m_verifier->verifyInteger(m_testCtx, m_testTargetName, referenceValue);
1503 expectError(GL_NO_ERROR);
1507 virtual void SetBlendEquation (GLenum equation)
1509 glBlendEquation(equation);
1512 StateVerifier* m_verifier;
1513 GLenum m_testTargetName;
1517 class BlendEquationSeparateTestCase : public BlendEquationTestCase
1520 BlendEquationSeparateTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, int initialValue)
1521 : BlendEquationTestCase (context, verifier, name, description, testTargetName, initialValue)
1526 void SetBlendEquation (GLenum equation)
1528 switch (m_testTargetName)
1530 case GL_BLEND_EQUATION_RGB:
1531 glBlendEquationSeparate(equation, GL_FUNC_ADD);
1534 case GL_BLEND_EQUATION_ALPHA:
1535 glBlendEquationSeparate(GL_FUNC_ADD, equation);
1539 DE_ASSERT(false && "should not happen");
1545 class ImplementationArrayTestCase : public ApiCase
1548 ImplementationArrayTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description, GLenum testTargetName, GLenum testTargetLengthTargetName, int minValue)
1549 : ApiCase (context, name, description)
1550 , m_verifier (verifier)
1551 , m_testTargetName (testTargetName)
1552 , m_testTargetLengthTargetName (testTargetLengthTargetName)
1553 , m_minValue (minValue)
1559 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, m_testTargetLengthTargetName, m_minValue);
1560 expectError(GL_NO_ERROR);
1562 GLint targetArrayLength = 0;
1563 glGetIntegerv(m_testTargetLengthTargetName, &targetArrayLength);
1564 expectError(GL_NO_ERROR);
1566 if (targetArrayLength)
1568 std::vector<GLint> queryResult;
1569 queryResult.resize(targetArrayLength, 0);
1571 glGetIntegerv(m_testTargetName, &queryResult[0]);
1572 expectError(GL_NO_ERROR);
1577 StateVerifier* m_verifier;
1578 GLenum m_testTargetName;
1579 GLenum m_testTargetLengthTargetName;
1583 class BindingTest : public TestCase
1586 BindingTest (Context& context,
1591 IterateResult iterate (void);
1593 virtual void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const = 0;
1596 const QueryType m_type;
1599 BindingTest::BindingTest (Context& context,
1603 : TestCase (context, name, desc)
1608 BindingTest::IterateResult BindingTest::iterate (void)
1610 glu::CallLogWrapper gl (m_context.getRenderContext().getFunctions(), m_context.getTestContext().getLog());
1611 tcu::ResultCollector result (m_context.getTestContext().getLog(), " // ERROR: ");
1613 gl.enableLogging(true);
1617 result.setTestContextResult(m_testCtx);
1621 class CurrentProgramBindingTestCase : public BindingTest
1624 CurrentProgramBindingTestCase (Context& context, QueryType type, const char* name, const char* description)
1625 : BindingTest(context, name, description, type)
1629 void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const
1631 static const char* testVertSource =
1632 "void main (void)\n"
1634 " gl_Position = vec4(0.0);\n"
1636 static const char* testFragSource =
1637 "void main (void)\n"
1639 " gl_FragColor = vec4(0.0);\n"
1645 GLint compileStatus;
1649 const tcu::ScopedLogSection section(gl.getLog(), "Initial", "Initial");
1651 verifyStateInteger(result, gl, GL_CURRENT_PROGRAM, 0, m_type);
1654 const tcu::ScopedLogSection section(gl.getLog(), "VertexShader", "Vertex Shader");
1656 shaderVert = gl.glCreateShader(GL_VERTEX_SHADER);
1657 gl.glShaderSource(shaderVert, 1, &testVertSource, DE_NULL);
1658 gl.glCompileShader(shaderVert);
1659 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glCompileShader");
1661 gl.glGetShaderiv(shaderVert, GL_COMPILE_STATUS, &compileStatus);
1662 if (compileStatus != GL_TRUE)
1663 result.fail("expected GL_TRUE");
1666 const tcu::ScopedLogSection section(gl.getLog(), "FragmentShader", "Fragment Shader");
1668 shaderFrag = gl.glCreateShader(GL_FRAGMENT_SHADER);
1669 gl.glShaderSource(shaderFrag, 1, &testFragSource, DE_NULL);
1670 gl.glCompileShader(shaderFrag);
1671 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glCompileShader");
1673 gl.glGetShaderiv(shaderFrag, GL_COMPILE_STATUS, &compileStatus);
1674 if (compileStatus != GL_TRUE)
1675 result.fail("expected GL_TRUE");
1678 const tcu::ScopedLogSection section(gl.getLog(), "Program", "Create and bind program");
1680 shaderProg = gl.glCreateProgram();
1681 gl.glAttachShader(shaderProg, shaderVert);
1682 gl.glAttachShader(shaderProg, shaderFrag);
1683 gl.glLinkProgram(shaderProg);
1684 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glLinkProgram");
1686 gl.glGetProgramiv(shaderProg, GL_LINK_STATUS, &linkStatus);
1687 if (linkStatus != GL_TRUE)
1688 result.fail("expected GL_TRUE");
1690 gl.glUseProgram(shaderProg);
1691 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glUseProgram");
1693 verifyStateInteger(result, gl, GL_CURRENT_PROGRAM, shaderProg, m_type);
1696 const tcu::ScopedLogSection section(gl.getLog(), "Delete", "Delete program while in use");
1698 gl.glDeleteShader(shaderVert);
1699 gl.glDeleteShader(shaderFrag);
1700 gl.glDeleteProgram(shaderProg);
1701 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glDeleteProgram");
1703 verifyStateInteger(result, gl, GL_CURRENT_PROGRAM, shaderProg, m_type);
1706 const tcu::ScopedLogSection section(gl.getLog(), "Unbind", "Unbind program");
1708 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glUseProgram");
1710 verifyStateInteger(result, gl, GL_CURRENT_PROGRAM, 0, m_type);
1715 class BufferBindingTestCase : public BindingTest
1718 BufferBindingTestCase (Context& context, QueryType type, const char* name, const char* description, GLenum bufferBindingName, GLenum bufferType)
1719 : BindingTest (context, name, description, type)
1720 , m_bufferBindingName (bufferBindingName)
1721 , m_bufferType (bufferType)
1725 void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const
1727 verifyStateInteger(result, gl, m_bufferBindingName, 0, m_type);
1729 GLuint bufferObject = 0;
1730 gl.glGenBuffers(1, &bufferObject);
1731 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGenBuffers");
1733 gl.glBindBuffer(m_bufferType, bufferObject);
1734 verifyStateInteger(result, gl, m_bufferBindingName, bufferObject, m_type);
1736 gl.glDeleteBuffers(1, &bufferObject);
1737 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glDeleteBuffers");
1739 verifyStateInteger(result, gl, m_bufferBindingName, 0, m_type);
1743 const GLenum m_bufferBindingName;
1744 const GLenum m_bufferType;
1747 class StencilClearValueTestCase : public ApiCase
1750 StencilClearValueTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
1751 : ApiCase (context, name, description)
1752 , m_verifier (verifier)
1758 m_verifier->verifyInteger(m_testCtx, GL_STENCIL_CLEAR_VALUE, 0);
1759 expectError(GL_NO_ERROR);
1761 const int stencilBits = m_context.getRenderTarget().getStencilBits();
1763 for (int stencilBit = 0; stencilBit < stencilBits; ++stencilBit)
1765 const int ref = 1 << stencilBit;
1767 glClearStencil(ref);
1768 expectError(GL_NO_ERROR);
1770 m_verifier->verifyInteger(m_testCtx, GL_STENCIL_CLEAR_VALUE, ref);
1771 expectError(GL_NO_ERROR);
1776 StateVerifier* m_verifier;
1779 class ActiveTextureTestCase : public ApiCase
1782 ActiveTextureTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
1783 : ApiCase (context, name, description)
1784 , m_verifier (verifier)
1790 m_verifier->verifyInteger(m_testCtx, GL_ACTIVE_TEXTURE, GL_TEXTURE0);
1791 expectError(GL_NO_ERROR);
1793 GLint textureUnits = 0;
1794 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &textureUnits);
1795 expectError(GL_NO_ERROR);
1797 for (int ndx = 0; ndx < textureUnits; ++ndx)
1799 glActiveTexture(GL_TEXTURE0 + ndx);
1800 expectError(GL_NO_ERROR);
1802 m_verifier->verifyInteger(m_testCtx, GL_ACTIVE_TEXTURE, GL_TEXTURE0 + ndx);
1803 expectError(GL_NO_ERROR);
1808 StateVerifier* m_verifier;
1811 class RenderbufferBindingTestCase : public BindingTest
1814 RenderbufferBindingTestCase (Context& context, QueryType type, const char* name, const char* description)
1815 : BindingTest(context, name, description, type)
1819 void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const
1821 verifyStateInteger(result, gl, GL_RENDERBUFFER_BINDING, 0, m_type);
1823 GLuint renderBuffer = 0;
1824 gl.glGenRenderbuffers(1, &renderBuffer);
1825 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGenRenderbuffers");
1827 gl.glBindRenderbuffer(GL_RENDERBUFFER, renderBuffer);
1828 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glBindRenderbuffer");
1830 verifyStateInteger(result, gl, GL_RENDERBUFFER_BINDING, renderBuffer, m_type);
1832 gl.glDeleteRenderbuffers(1, &renderBuffer);
1833 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glDeleteRenderbuffers");
1835 verifyStateInteger(result, gl, GL_RENDERBUFFER_BINDING, 0, m_type);
1839 class TextureBindingTestCase : public BindingTest
1842 TextureBindingTestCase (Context& context, QueryType type, const char* name, const char* description, GLenum testBindingName, GLenum textureType)
1843 : BindingTest (context, name, description, type)
1844 , m_testBindingName (testBindingName)
1845 , m_textureType (textureType)
1849 void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const
1851 verifyStateInteger(result, gl, m_testBindingName, 0, m_type);
1854 gl.glGenTextures(1, &texture);
1855 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGenTextures");
1857 gl.glBindTexture(m_textureType, texture);
1858 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glBindTexture");
1860 verifyStateInteger(result, gl, m_testBindingName, texture, m_type);
1862 gl.glDeleteTextures(1, &texture);
1863 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glDeleteTextures");
1865 verifyStateInteger(result, gl, m_testBindingName, 0, m_type);
1868 const GLenum m_testBindingName;
1869 const GLenum m_textureType;
1872 class FrameBufferBindingTestCase : public BindingTest
1875 FrameBufferBindingTestCase (Context& context, QueryType type, const char* name, const char* description)
1876 : BindingTest(context, name, description, type)
1880 void test (glu::CallLogWrapper& gl, tcu::ResultCollector& result) const
1882 verifyStateInteger(result, gl, GL_FRAMEBUFFER_BINDING, 0, m_type);
1884 GLuint framebufferId = 0;
1885 gl.glGenFramebuffers(1, &framebufferId);
1886 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glGenFramebuffers");
1888 gl.glBindFramebuffer(GL_FRAMEBUFFER, framebufferId);
1889 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glBindFramebuffer");
1891 verifyStateInteger(result, gl, GL_FRAMEBUFFER_BINDING, framebufferId, m_type);
1893 gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1894 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glBindFramebuffer");
1896 verifyStateInteger(result, gl, GL_FRAMEBUFFER_BINDING, 0, m_type);
1898 gl.glBindFramebuffer(GL_FRAMEBUFFER, framebufferId);
1899 gl.glDeleteFramebuffers(1, &framebufferId);
1900 GLS_COLLECT_GL_ERROR(result, gl.glGetError(), "glDeleteFramebuffers");
1902 verifyStateInteger(result, gl, GL_FRAMEBUFFER_BINDING, 0, m_type);
1906 class ImplementationColorReadTestCase : public ApiCase
1909 ImplementationColorReadTestCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
1910 : ApiCase (context, name, description)
1911 , m_verifier (verifier)
1917 const GLint defaultColorTypes[] =
1919 GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_5_6_5
1921 const GLint defaultColorFormats[] =
1923 GL_RGBA, GL_RGB, GL_ALPHA
1926 std::vector<GLint> validColorTypes;
1927 std::vector<GLint> validColorFormats;
1929 // Defined by the spec
1931 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(defaultColorTypes); ++ndx)
1932 validColorTypes.push_back(defaultColorTypes[ndx]);
1933 for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(defaultColorFormats); ++ndx)
1934 validColorFormats.push_back(defaultColorFormats[ndx]);
1938 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_format_BGRA8888") ||
1939 m_context.getContextInfo().isExtensionSupported("GL_APPLE_texture_format_BGRA8888"))
1940 validColorFormats.push_back(GL_BGRA);
1942 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_read_format_bgra"))
1944 validColorFormats.push_back(GL_BGRA);
1945 validColorTypes.push_back(GL_UNSIGNED_SHORT_4_4_4_4_REV);
1946 validColorTypes.push_back(GL_UNSIGNED_SHORT_1_5_5_5_REV);
1949 if (m_context.getContextInfo().isExtensionSupported("GL_IMG_read_format"))
1951 validColorFormats.push_back(GL_BGRA);
1952 validColorTypes.push_back(GL_UNSIGNED_SHORT_4_4_4_4_REV);
1955 if (m_context.getContextInfo().isExtensionSupported("GL_NV_sRGB_formats"))
1957 validColorFormats.push_back(GL_SLUMINANCE_NV);
1958 validColorFormats.push_back(GL_SLUMINANCE_ALPHA_NV);
1961 if (m_context.getContextInfo().isExtensionSupported("GL_NV_bgr"))
1963 validColorFormats.push_back(GL_BGR_NV);
1966 if (m_context.getContextInfo().isExtensionSupported("GL_EXT_texture_rg"))
1968 validColorFormats.push_back(GL_RED);
1969 validColorFormats.push_back(GL_RG);
1972 m_verifier->verifyIntegerAnyOf(m_testCtx, GL_IMPLEMENTATION_COLOR_READ_TYPE, &validColorTypes[0], validColorTypes.size());
1973 m_verifier->verifyIntegerAnyOf(m_testCtx, GL_IMPLEMENTATION_COLOR_READ_FORMAT, &validColorFormats[0], validColorFormats.size());
1974 expectError(GL_NO_ERROR);
1978 StateVerifier* m_verifier;
1981 class BufferComponentSizeCase : public ApiCase
1984 BufferComponentSizeCase (Context& context, StateVerifier* verifier, const char* name, const char* description)
1985 : ApiCase (context, name, description)
1986 , m_verifier (verifier)
1992 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_RED_BITS, m_context.getRenderTarget().getPixelFormat().redBits);
1993 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_BLUE_BITS, m_context.getRenderTarget().getPixelFormat().blueBits);
1994 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_GREEN_BITS, m_context.getRenderTarget().getPixelFormat().greenBits);
1995 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_ALPHA_BITS, m_context.getRenderTarget().getPixelFormat().alphaBits);
1996 expectError(GL_NO_ERROR);
1998 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_DEPTH_BITS, m_context.getRenderTarget().getDepthBits());
1999 m_verifier->verifyIntegerGreaterOrEqual(m_testCtx, GL_STENCIL_BITS, m_context.getRenderTarget().getStencilBits());
2000 expectError(GL_NO_ERROR);
2003 StateVerifier* m_verifier;
2006 static const char* getQueryTypeSuffix (QueryType type)
2010 case QUERY_BOOLEAN: return "_getboolean";
2011 case QUERY_INTEGER: return "_getinteger";
2012 case QUERY_FLOAT: return "_getfloat";
2014 DE_ASSERT(DE_FALSE);
2019 #define FOR_EACH_VERIFIER(VERIFIERS, CODE_BLOCK) \
2020 for (int _verifierNdx = 0; _verifierNdx < DE_LENGTH_OF_ARRAY(VERIFIERS); _verifierNdx++) \
2022 StateVerifier* verifier = (VERIFIERS)[_verifierNdx]; \
2026 #define FOR_EACH_QUERYTYPE(QUERYTYPES, CODE_BLOCK) \
2027 for (int _queryTypeNdx = 0; _queryTypeNdx < DE_LENGTH_OF_ARRAY(QUERYTYPES); _queryTypeNdx++) \
2029 const QueryType queryType = (QUERYTYPES)[_queryTypeNdx]; \
2035 IntegerStateQueryTests::IntegerStateQueryTests (Context& context)
2036 : TestCaseGroup (context, "integers", "Integer Values")
2037 , m_verifierBoolean (DE_NULL)
2038 , m_verifierInteger (DE_NULL)
2039 , m_verifierFloat (DE_NULL)
2043 IntegerStateQueryTests::~IntegerStateQueryTests (void)
2048 void IntegerStateQueryTests::init (void)
2050 static const QueryType queryTypes[] =
2057 DE_ASSERT(m_verifierBoolean == DE_NULL);
2058 DE_ASSERT(m_verifierInteger == DE_NULL);
2059 DE_ASSERT(m_verifierFloat == DE_NULL);
2061 m_verifierBoolean = new GetBooleanVerifier (m_context.getRenderContext().getFunctions(), m_context.getTestContext().getLog());
2062 m_verifierInteger = new GetIntegerVerifier (m_context.getRenderContext().getFunctions(), m_context.getTestContext().getLog());
2063 m_verifierFloat = new GetFloatVerifier (m_context.getRenderContext().getFunctions(), m_context.getTestContext().getLog());
2065 const struct LimitedStateInteger
2068 const char* description;
2071 } implementationMinLimits[] =
2073 { "subpixel_bits", "SUBPIXEL_BITS has a minimum value of 4", GL_SUBPIXEL_BITS, 4 },
2074 { "max_texture_size", "MAX_TEXTURE_SIZE has a minimum value of 64", GL_MAX_TEXTURE_SIZE, 64 },
2075 { "max_cube_map_texture_size", "MAX_CUBE_MAP_TEXTURE_SIZE has a minimum value of 16", GL_MAX_CUBE_MAP_TEXTURE_SIZE, 16 },
2076 { "max_vertex_attribs", "MAX_VERTEX_ATTRIBS has a minimum value of 8", GL_MAX_VERTEX_ATTRIBS, 8 },
2077 { "max_vertex_uniform_vectors", "MAX_VERTEX_UNIFORM_VECTORS has a minimum value of 128", GL_MAX_VERTEX_UNIFORM_VECTORS, 128 },
2078 { "max_varying_vectors", "MAX_VARYING_VECTORS has a minimum value of 8", GL_MAX_VARYING_VECTORS, 8 },
2079 { "max_combined_texture_image_units", "MAX_COMBINED_TEXTURE_IMAGE_UNITS has a minimum value of 8", GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 8 },
2080 { "max_vertex_texture_image_units", "MAX_VERTEX_TEXTURE_IMAGE_UNITS has a minimum value of 0", GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 0 },
2081 { "max_texture_image_units", "MAX_TEXTURE_IMAGE_UNITS has a minimum value of 8", GL_MAX_TEXTURE_IMAGE_UNITS, 8 },
2082 { "max_fragment_uniform_vectors", "MAX_FRAGMENT_UNIFORM_VECTORS has a minimum value of 16", GL_MAX_FRAGMENT_UNIFORM_VECTORS, 16 },
2083 { "max_renderbuffer_size", "MAX_RENDERBUFFER_SIZE has a minimum value of 1", GL_MAX_RENDERBUFFER_SIZE, 1 },
2086 // \note implementation defined limits have their own tests so just check the conversions to boolean and float
2087 StateVerifier* implementationLimitVerifiers[] = {m_verifierBoolean, m_verifierFloat};
2088 StateVerifier* normalVerifiers[] = {m_verifierBoolean, m_verifierInteger, m_verifierFloat};
2090 for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(implementationMinLimits); testNdx++)
2091 FOR_EACH_VERIFIER(implementationLimitVerifiers, addChild(new ConstantMinimumValueTestCase(m_context, verifier, (std::string(implementationMinLimits[testNdx].name) + verifier->getTestNamePostfix()).c_str(), implementationMinLimits[testNdx].description, implementationMinLimits[testNdx].targetName, implementationMinLimits[testNdx].value)));
2093 FOR_EACH_VERIFIER(implementationLimitVerifiers, addChild(new SampleBuffersTestCase (m_context, verifier, (std::string("sample_buffers") + verifier->getTestNamePostfix()).c_str(), "SAMPLE_BUFFERS")));
2095 FOR_EACH_VERIFIER(normalVerifiers, addChild(new SamplesTestCase (m_context, verifier, (std::string("samples") + verifier->getTestNamePostfix()).c_str(), "SAMPLES")));
2096 FOR_EACH_VERIFIER(normalVerifiers, addChild(new HintTestCase (m_context, verifier, (std::string("generate_mipmap_hint") + verifier->getTestNamePostfix()).c_str(), "GENERATE_MIPMAP_HINT", GL_GENERATE_MIPMAP_HINT)));
2097 FOR_EACH_VERIFIER(normalVerifiers, addChild(new DepthFuncTestCase (m_context, verifier, (std::string("depth_func") + verifier->getTestNamePostfix()).c_str(), "DEPTH_FUNC")));
2098 FOR_EACH_VERIFIER(normalVerifiers, addChild(new CullFaceTestCase (m_context, verifier, (std::string("cull_face_mode") + verifier->getTestNamePostfix()).c_str(), "CULL_FACE_MODE")));
2099 FOR_EACH_VERIFIER(normalVerifiers, addChild(new FrontFaceTestCase (m_context, verifier, (std::string("front_face_mode") + verifier->getTestNamePostfix()).c_str(), "FRONT_FACE")));
2100 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ViewPortTestCase (m_context, verifier, (std::string("viewport") + verifier->getTestNamePostfix()).c_str(), "VIEWPORT")));
2101 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ScissorBoxTestCase (m_context, verifier, (std::string("scissor_box") + verifier->getTestNamePostfix()).c_str(), "SCISSOR_BOX")));
2102 FOR_EACH_VERIFIER(normalVerifiers, addChild(new MaxViewportDimsTestCase (m_context, verifier, (std::string("max_viewport_dims") + verifier->getTestNamePostfix()).c_str(), "MAX_VIEWPORT_DIMS")));
2103 FOR_EACH_VERIFIER(normalVerifiers, addChild(new BufferComponentSizeCase (m_context, verifier, (std::string("buffer_component_size") + verifier->getTestNamePostfix()).c_str(), "x BITS")));
2104 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefTestCase (m_context, verifier, (std::string("stencil_ref") + verifier->getTestNamePostfix()).c_str(), "STENCIL_REF", GL_STENCIL_REF)));
2105 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefTestCase (m_context, verifier, (std::string("stencil_back_ref") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_REF", GL_STENCIL_BACK_REF)));
2106 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefSeparateTestCase (m_context, verifier, (std::string("stencil_ref_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_REF (separate)", GL_STENCIL_REF, GL_FRONT)));
2107 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefSeparateTestCase (m_context, verifier, (std::string("stencil_ref_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_REF (separate)", GL_STENCIL_REF, GL_FRONT_AND_BACK)));
2108 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefSeparateTestCase (m_context, verifier, (std::string("stencil_back_ref_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_REF (separate)", GL_STENCIL_BACK_REF, GL_BACK)));
2109 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilRefSeparateTestCase (m_context, verifier, (std::string("stencil_back_ref_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_REF (separate)", GL_STENCIL_BACK_REF, GL_FRONT_AND_BACK)));
2111 const struct NamedStencilOp
2115 const char* frontDescription;
2117 const char* backDescription;
2121 { "fail", "STENCIL_FAIL", GL_STENCIL_FAIL, "STENCIL_BACK_FAIL", GL_STENCIL_BACK_FAIL },
2122 { "depth_fail", "STENCIL_PASS_DEPTH_FAIL", GL_STENCIL_PASS_DEPTH_FAIL, "STENCIL_BACK_PASS_DEPTH_FAIL", GL_STENCIL_BACK_PASS_DEPTH_FAIL },
2123 { "depth_pass", "STENCIL_PASS_DEPTH_PASS", GL_STENCIL_PASS_DEPTH_PASS, "STENCIL_BACK_PASS_DEPTH_PASS", GL_STENCIL_BACK_PASS_DEPTH_PASS }
2126 for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(stencilOps); testNdx++)
2128 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpTestCase (m_context, verifier, (std::string("stencil_") + stencilOps[testNdx].name + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget)));
2129 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpTestCase (m_context, verifier, (std::string("stencil_back_") + stencilOps[testNdx].name + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget)));
2131 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpSeparateTestCase (m_context, verifier, (std::string("stencil_") + stencilOps[testNdx].name + "_separate_both" + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, GL_FRONT_AND_BACK)));
2132 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpSeparateTestCase (m_context, verifier, (std::string("stencil_back_") + stencilOps[testNdx].name + "_separate_both" + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, GL_FRONT_AND_BACK)));
2134 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpSeparateTestCase (m_context, verifier, (std::string("stencil_") + stencilOps[testNdx].name + "_separate" + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].frontDescription, stencilOps[testNdx].frontTarget, GL_FRONT)));
2135 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilOpSeparateTestCase (m_context, verifier, (std::string("stencil_back_") + stencilOps[testNdx].name + "_separate" + verifier->getTestNamePostfix()).c_str(), stencilOps[testNdx].backDescription, stencilOps[testNdx].backTarget, GL_BACK)));
2138 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilFuncTestCase (m_context, verifier, (std::string("stencil_func") + verifier->getTestNamePostfix()).c_str(), "STENCIL_FUNC")));
2139 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilFuncSeparateTestCase (m_context, verifier, (std::string("stencil_func_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_FUNC (separate)", GL_STENCIL_FUNC, GL_FRONT)));
2140 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilFuncSeparateTestCase (m_context, verifier, (std::string("stencil_func_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_FUNC (separate)", GL_STENCIL_FUNC, GL_FRONT_AND_BACK)));
2141 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilFuncSeparateTestCase (m_context, verifier, (std::string("stencil_back_func_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_FUNC (separate)", GL_STENCIL_BACK_FUNC, GL_BACK)));
2142 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilFuncSeparateTestCase (m_context, verifier, (std::string("stencil_back_func_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_FUNC (separate)", GL_STENCIL_BACK_FUNC, GL_FRONT_AND_BACK)));
2143 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskTestCase (m_context, verifier, (std::string("stencil_value_mask") + verifier->getTestNamePostfix()).c_str(), "STENCIL_VALUE_MASK", GL_STENCIL_VALUE_MASK)));
2144 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskTestCase (m_context, verifier, (std::string("stencil_back_value_mask") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_VALUE_MASK", GL_STENCIL_BACK_VALUE_MASK)));
2145 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskSeparateTestCase (m_context, verifier, (std::string("stencil_value_mask_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_VALUE_MASK (separate)", GL_STENCIL_VALUE_MASK, GL_FRONT)));
2146 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskSeparateTestCase (m_context, verifier, (std::string("stencil_value_mask_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_VALUE_MASK (separate)", GL_STENCIL_VALUE_MASK, GL_FRONT_AND_BACK)));
2147 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskSeparateTestCase (m_context, verifier, (std::string("stencil_back_value_mask_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_VALUE_MASK (separate)", GL_STENCIL_BACK_VALUE_MASK, GL_BACK)));
2148 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilMaskSeparateTestCase (m_context, verifier, (std::string("stencil_back_value_mask_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_VALUE_MASK (separate)", GL_STENCIL_BACK_VALUE_MASK, GL_FRONT_AND_BACK)));
2149 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskTestCase (m_context, verifier, (std::string("stencil_writemask") + verifier->getTestNamePostfix()).c_str(), "STENCIL_WRITEMASK", GL_STENCIL_WRITEMASK)));
2150 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskTestCase (m_context, verifier, (std::string("stencil_back_writemask") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_WRITEMASK", GL_STENCIL_BACK_WRITEMASK)));
2151 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskSeparateTestCase (m_context, verifier, (std::string("stencil_writemask_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_WRITEMASK (separate)", GL_STENCIL_WRITEMASK, GL_FRONT)));
2152 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskSeparateTestCase (m_context, verifier, (std::string("stencil_writemask_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_WRITEMASK (separate)", GL_STENCIL_WRITEMASK, GL_FRONT_AND_BACK)));
2153 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskSeparateTestCase (m_context, verifier, (std::string("stencil_back_writemask_separate") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_WRITEMASK (separate)", GL_STENCIL_BACK_WRITEMASK, GL_BACK)));
2154 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilWriteMaskSeparateTestCase (m_context, verifier, (std::string("stencil_back_writemask_separate_both") + verifier->getTestNamePostfix()).c_str(), "STENCIL_BACK_WRITEMASK (separate)", GL_STENCIL_BACK_WRITEMASK, GL_FRONT_AND_BACK)));
2156 FOR_EACH_VERIFIER(normalVerifiers, addChild(new PixelStoreAlignTestCase(m_context, verifier, (std::string("unpack_alignment") + verifier->getTestNamePostfix()).c_str(), "UNPACK_ALIGNMENT", GL_UNPACK_ALIGNMENT)));
2157 FOR_EACH_VERIFIER(normalVerifiers, addChild(new PixelStoreAlignTestCase(m_context, verifier, (std::string("pack_alignment") + verifier->getTestNamePostfix()).c_str(), "PACK_ALIGNMENT", GL_PACK_ALIGNMENT)));
2160 const struct BlendColorState
2163 const char* description;
2166 } blendColorStates[] =
2168 { "blend_src_rgb", "BLEND_SRC_RGB", GL_BLEND_SRC_RGB, GL_ONE },
2169 { "blend_src_alpha", "BLEND_SRC_ALPHA", GL_BLEND_SRC_ALPHA, GL_ONE },
2170 { "blend_dst_rgb", "BLEND_DST_RGB", GL_BLEND_DST_RGB, GL_ZERO },
2171 { "blend_dst_alpha", "BLEND_DST_ALPHA", GL_BLEND_DST_ALPHA, GL_ZERO }
2173 for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(blendColorStates); testNdx++)
2175 FOR_EACH_VERIFIER(normalVerifiers, addChild(new BlendFuncTestCase (m_context, verifier, (std::string(blendColorStates[testNdx].name) + verifier->getTestNamePostfix()).c_str(), blendColorStates[testNdx].description, blendColorStates[testNdx].target, blendColorStates[testNdx].initialValue)));
2176 FOR_EACH_VERIFIER(normalVerifiers, addChild(new BlendFuncSeparateTestCase (m_context, verifier, (std::string(blendColorStates[testNdx].name) + "_separate" + verifier->getTestNamePostfix()).c_str(), blendColorStates[testNdx].description, blendColorStates[testNdx].target, blendColorStates[testNdx].initialValue)));
2181 const struct BlendEquationState
2184 const char* description;
2187 } blendEquationStates[] =
2189 { "blend_equation_rgb", "BLEND_EQUATION_RGB", GL_BLEND_EQUATION_RGB, GL_FUNC_ADD },
2190 { "blend_equation_alpha", "BLEND_EQUATION_ALPHA", GL_BLEND_EQUATION_ALPHA, GL_FUNC_ADD }
2192 for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(blendEquationStates); testNdx++)
2194 FOR_EACH_VERIFIER(normalVerifiers, addChild(new BlendEquationTestCase (m_context, verifier, (std::string(blendEquationStates[testNdx].name) + + verifier->getTestNamePostfix()).c_str(), blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue)));
2195 FOR_EACH_VERIFIER(normalVerifiers, addChild(new BlendEquationSeparateTestCase (m_context, verifier, (std::string(blendEquationStates[testNdx].name) + "_separate" + verifier->getTestNamePostfix()).c_str(), blendEquationStates[testNdx].description, blendEquationStates[testNdx].target, blendEquationStates[testNdx].initialValue)));
2199 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ImplementationArrayTestCase (m_context, verifier, (std::string("compressed_texture_formats") + verifier->getTestNamePostfix()).c_str(), "COMPRESSED_TEXTURE_FORMATS", GL_COMPRESSED_TEXTURE_FORMATS, GL_NUM_COMPRESSED_TEXTURE_FORMATS, 0)));
2200 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ImplementationArrayTestCase (m_context, verifier, (std::string("shader_binary_formats") + verifier->getTestNamePostfix()).c_str(), "SHADER_BINARY_FORMATS", GL_SHADER_BINARY_FORMATS, GL_NUM_SHADER_BINARY_FORMATS, 0)));
2202 FOR_EACH_QUERYTYPE(queryTypes, addChild(new BufferBindingTestCase (m_context, queryType, (std::string("array_buffer_binding") + getQueryTypeSuffix(queryType)).c_str(), "ARRAY_BUFFER_BINDING", GL_ARRAY_BUFFER_BINDING, GL_ARRAY_BUFFER)));
2203 FOR_EACH_QUERYTYPE(queryTypes, addChild(new BufferBindingTestCase (m_context, queryType, (std::string("element_array_buffer_binding") + getQueryTypeSuffix(queryType)).c_str(), "ELEMENT_ARRAY_BUFFER_BINDING", GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_ELEMENT_ARRAY_BUFFER)));
2205 FOR_EACH_QUERYTYPE(queryTypes, addChild(new CurrentProgramBindingTestCase (m_context, queryType, (std::string("current_program_binding") + getQueryTypeSuffix(queryType)).c_str(), "CURRENT_PROGRAM")));
2206 FOR_EACH_VERIFIER(normalVerifiers, addChild(new StencilClearValueTestCase (m_context, verifier, (std::string("stencil_clear_value") + verifier->getTestNamePostfix()).c_str(), "STENCIL_CLEAR_VALUE")));
2207 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ActiveTextureTestCase (m_context, verifier, (std::string("active_texture") + verifier->getTestNamePostfix()).c_str(), "ACTIVE_TEXTURE")));
2208 FOR_EACH_QUERYTYPE(queryTypes, addChild(new RenderbufferBindingTestCase (m_context, queryType, (std::string("renderbuffer_binding") + getQueryTypeSuffix(queryType)).c_str(), "RENDERBUFFER_BINDING")));
2210 FOR_EACH_QUERYTYPE(queryTypes, addChild(new TextureBindingTestCase (m_context, queryType, (std::string("texture_binding_2d") + getQueryTypeSuffix(queryType)).c_str(), "TEXTURE_BINDING_2D", GL_TEXTURE_BINDING_2D, GL_TEXTURE_2D)));
2211 FOR_EACH_QUERYTYPE(queryTypes, addChild(new TextureBindingTestCase (m_context, queryType, (std::string("texture_binding_cube_map") + getQueryTypeSuffix(queryType)).c_str(), "TEXTURE_BINDING_CUBE_MAP", GL_TEXTURE_BINDING_CUBE_MAP, GL_TEXTURE_CUBE_MAP)));
2213 FOR_EACH_QUERYTYPE(queryTypes, addChild(new FrameBufferBindingTestCase (m_context, queryType, (std::string("framebuffer_binding") + getQueryTypeSuffix(queryType)).c_str(), "DRAW_FRAMEBUFFER_BINDING and READ_FRAMEBUFFER_BINDING")));
2214 FOR_EACH_VERIFIER(normalVerifiers, addChild(new ImplementationColorReadTestCase (m_context, verifier, (std::string("implementation_color_read") + verifier->getTestNamePostfix()).c_str(), "IMPLEMENTATION_COLOR_READ_TYPE and IMPLEMENTATION_COLOR_READ_FORMAT")));
2217 void IntegerStateQueryTests::deinit (void)
2219 if (m_verifierBoolean)
2221 delete m_verifierBoolean;
2222 m_verifierBoolean = DE_NULL;
2224 if (m_verifierInteger)
2226 delete m_verifierInteger;
2227 m_verifierInteger = DE_NULL;
2229 if (m_verifierFloat)
2231 delete m_verifierFloat;
2232 m_verifierFloat = DE_NULL;
2235 this->TestCaseGroup::deinit();