1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program EGL Module
3 * ---------------------------------------
5 * Copyright 2017 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 Test KHR_wide_color
22 *//*--------------------------------------------------------------------*/
24 #include "teglWideColorTests.hpp"
26 #include "tcuImageCompare.hpp"
27 #include "tcuTestLog.hpp"
28 #include "tcuSurface.hpp"
29 #include "tcuTextureUtil.hpp"
31 #include "egluNativeWindow.hpp"
32 #include "egluStrUtil.hpp"
33 #include "egluUtil.hpp"
34 #include "egluConfigFilter.hpp"
36 #include "eglwLibrary.hpp"
37 #include "eglwEnums.hpp"
39 #include "gluDefs.hpp"
40 #include "gluRenderContext.hpp"
41 #include "gluShaderProgram.hpp"
43 #include "glwDefs.hpp"
44 #include "glwEnums.hpp"
45 #include "glwFunctions.hpp"
48 #include "deRandom.hpp"
50 #include "deStringUtil.hpp"
71 typedef tcu::Vec4 Color;
75 class ReferenceRenderer;
77 class WideColorTests : public TestCaseGroup
80 WideColorTests (EglTestContext& eglTestCtx);
84 WideColorTests (const WideColorTests&);
85 WideColorTests& operator= (const WideColorTests&);
88 class WideColorTest : public TestCase
97 WideColorTest (EglTestContext& eglTestCtx, const char* name, const char* description);
98 ~WideColorTest (void);
104 void initEGLSurface (EGLConfig config);
105 void initEGLContext (EGLConfig config);
107 EGLDisplay m_eglDisplay;
114 ColoredRect (const IVec2& bottomLeft_, const IVec2& topRight_, const Color& color_);
120 ColoredRect::ColoredRect (const IVec2& bottomLeft_, const IVec2& topRight_, const Color& color_)
121 : bottomLeft (bottomLeft_)
122 , topRight (topRight_)
127 void clearColorScreen (const glw::Functions& gl, const Color& clearColor)
129 gl.clearColor(clearColor.x(), clearColor.y(), clearColor.z(), clearColor.w());
130 gl.clear(GL_COLOR_BUFFER_BIT);
133 float windowToDeviceCoordinates (int x, int length)
135 return (2.0f * float(x) / float(length)) - 1.0f;
141 GLES2Renderer (const glw::Functions& gl, int width, int height);
142 ~GLES2Renderer (void);
143 void render (const ColoredRect& coloredRect) const;
146 GLES2Renderer (const GLES2Renderer&);
147 GLES2Renderer& operator= (const GLES2Renderer&);
149 const glw::Functions& m_gl;
150 glu::ShaderProgram m_glProgram;
151 glw::GLuint m_coordLoc;
152 glw::GLuint m_colorLoc;
153 glw::GLuint m_bufWidth;
154 glw::GLuint m_bufHeight;
157 // generate sources for vertex and fragment buffer
158 glu::ProgramSources getSources (void)
160 const char* const vertexShaderSource =
161 "attribute mediump vec2 a_pos;\n"
162 "attribute mediump vec4 a_color;\n"
163 "varying mediump vec4 v_color;\n"
166 "\tv_color = a_color;\n"
167 "\tgl_Position = vec4(a_pos, 0.0, 1.0);\n"
170 const char* const fragmentShaderSource =
171 "varying mediump vec4 v_color;\n"
174 "\tgl_FragColor = v_color;\n"
177 return glu::makeVtxFragSources(vertexShaderSource, fragmentShaderSource);
180 GLES2Renderer::GLES2Renderer (const glw::Functions& gl, int width, int height)
182 , m_glProgram (gl, getSources())
183 , m_coordLoc ((glw::GLuint)-1)
184 , m_colorLoc ((glw::GLuint)-1)
186 , m_bufHeight (height)
188 m_colorLoc = m_gl.getAttribLocation(m_glProgram.getProgram(), "a_color");
189 m_coordLoc = m_gl.getAttribLocation(m_glProgram.getProgram(), "a_pos");
190 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Failed to get attribute locations");
193 GLES2Renderer::~GLES2Renderer (void)
197 void GLES2Renderer::render (const struct ColoredRect &coloredRect) const
199 const float x1 = windowToDeviceCoordinates(coloredRect.bottomLeft.x(), m_bufWidth);
200 const float y1 = windowToDeviceCoordinates(coloredRect.bottomLeft.y(), m_bufHeight);
201 const float x2 = windowToDeviceCoordinates(coloredRect.topRight.x(), m_bufWidth);
202 const float y2 = windowToDeviceCoordinates(coloredRect.topRight.y(), m_bufHeight);
204 const glw::GLfloat coords[] =
215 const glw::GLfloat colors[] =
217 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
218 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
219 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
221 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
222 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
223 coloredRect.color.x(), coloredRect.color.y(), coloredRect.color.z(), coloredRect.color.w(),
226 m_gl.useProgram(m_glProgram.getProgram());
227 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glUseProgram() failed");
229 m_gl.enableVertexAttribArray(m_coordLoc);
230 m_gl.enableVertexAttribArray(m_colorLoc);
231 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Failed to enable attributes");
233 m_gl.vertexAttribPointer(m_coordLoc, 4, GL_FLOAT, GL_FALSE, 0, coords);
234 m_gl.vertexAttribPointer(m_colorLoc, 4, GL_FLOAT, GL_TRUE, 0, colors);
235 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Failed to set attribute pointers");
237 m_gl.drawArrays(GL_TRIANGLES, 0, DE_LENGTH_OF_ARRAY(coords)/4);
238 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glDrawArrays(), failed");
240 m_gl.disableVertexAttribArray(m_coordLoc);
241 m_gl.disableVertexAttribArray(m_colorLoc);
242 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Failed to disable attributes");
245 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glUseProgram() failed");
248 class ReferenceRenderer
251 ReferenceRenderer (void);
253 ReferenceRenderer (const ReferenceRenderer&);
254 ReferenceRenderer& operator= (const ReferenceRenderer&);
257 ReferenceRenderer::ReferenceRenderer (void)
261 WideColorTest::WideColorTest (EglTestContext& eglTestCtx, const char* name, const char* description)
262 : TestCase (eglTestCtx, name, description)
263 , m_eglDisplay (EGL_NO_DISPLAY)
267 WideColorTest::~WideColorTest (void)
272 void WideColorTest::init (void)
274 const Library& egl = m_eglTestCtx.getLibrary();
276 m_eglDisplay = eglu::getAndInitDisplay(m_eglTestCtx.getNativeDisplay());
278 m_eglTestCtx.initGLFunctions(&m_gl, glu::ApiType::es(2,0));
280 // Wide-color support requires these extensions: EGL_EXT_pixel_format_float,
281 // EGL_EXT_gl_colorspace_display_p3, EGL_EXT_gl_colorspace_display_p3_linear
282 if (!eglu::hasExtension(egl, m_eglDisplay, "EGL_EXT_pixel_format_float"))
283 TCU_THROW(NotSupportedError, "EGL_EXT_pixel_format_float is not supported");
285 if (!eglu::hasExtension(egl, m_eglDisplay, "EGL_EXT_gl_colorspace_display_p3"))
286 TCU_THROW(NotSupportedError, "EGL_EXT_gl_colorspace_display_p3 is not supported");
288 if (!eglu::hasExtension(egl, m_eglDisplay, "EGL_EXT_gl_colorspace_display_p3_linear"))
289 TCU_THROW(NotSupportedError, "EGL_EXT_gl_colorspace_display_p3_linear is not supported");
293 void WideColorTest::deinit (void)
295 const Library& egl = m_eglTestCtx.getLibrary();
297 if (m_eglDisplay != EGL_NO_DISPLAY)
299 egl.terminate(m_eglDisplay);
300 m_eglDisplay = EGL_NO_DISPLAY;
304 class WideColorFP16Test : public WideColorTest
307 WideColorFP16Test (EglTestContext& eglTestCtx, const char* name, const char* description);
310 void executeTest (void);
311 IterateResult iterate (void);
314 WideColorFP16Test::WideColorFP16Test (EglTestContext& eglTestCtx,
316 const char* description)
317 : WideColorTest(eglTestCtx, name, description)
321 void WideColorFP16Test::executeTest (void)
323 const Library& egl = m_eglTestCtx.getLibrary();
324 tcu::TestLog& log = m_testCtx.getLog();
325 EGLint numConfigs = 0;
328 const EGLint attribList[] =
330 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
331 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
336 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT,
340 // Query from EGL implementation
341 EGLU_CHECK_CALL(egl, chooseConfig(m_eglDisplay, &attribList[0], DE_NULL, 0, &numConfigs));
345 log << tcu::TestLog::Message << "No configs returned." << tcu::TestLog::EndMessage;
346 TCU_FAIL("No configs returned");
349 log << tcu::TestLog::Message << numConfigs << " configs returned" << tcu::TestLog::EndMessage;
351 EGLBoolean success = egl.chooseConfig(m_eglDisplay, &attribList[0], &config, 1, &numConfigs);
352 if (success != EGL_TRUE)
354 log << tcu::TestLog::Message << "Fail, eglChooseConfig returned an error." << tcu::TestLog::EndMessage;
355 TCU_FAIL("eglChooseConfig failed");
359 log << tcu::TestLog::Message << "Fail, more configs returned than requested." << tcu::TestLog::EndMessage;
360 TCU_FAIL("Too many configs returned");
363 EGLint components[4];
365 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_RED_SIZE, &components[0]);
366 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
368 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_GREEN_SIZE, &components[1]);
369 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
371 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_BLUE_SIZE, &components[2]);
372 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
374 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_ALPHA_SIZE, &components[3]);
375 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
378 TCU_CHECK_MSG(components[0] == 16, "Missing 16bit deep red channel");
379 TCU_CHECK_MSG(components[1] == 16, "Missing 16bit deep green channel");
380 TCU_CHECK_MSG(components[2] == 16, "Missing 16bit deep blue channel");
381 TCU_CHECK_MSG(components[3] == 16, "Missing 16bit deep alpha channel");
384 TestCase::IterateResult WideColorFP16Test::iterate (void)
386 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
391 void WideColorFP16Test::init (void)
393 WideColorTest::init();
396 class WideColor1010102Test : public WideColorTest
399 WideColor1010102Test (EglTestContext& eglTestCtx,
401 const char* description);
404 void executeTest (void);
405 IterateResult iterate (void);
408 WideColor1010102Test::WideColor1010102Test (EglTestContext& eglTestCtx, const char* name, const char* description)
409 : WideColorTest(eglTestCtx, name, description)
413 void WideColor1010102Test::init (void)
415 WideColorTest::init();
418 void WideColor1010102Test::executeTest (void)
420 const Library& egl = m_eglTestCtx.getLibrary();
421 tcu::TestLog& log = m_testCtx.getLog();
423 EGLint attribList[] =
425 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
426 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
431 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,
434 EGLint numConfigs = 0;
437 // Query from EGL implementation
438 EGLU_CHECK_CALL(egl, chooseConfig(m_eglDisplay, &attribList[0], DE_NULL, 0, &numConfigs));
442 log << tcu::TestLog::Message << "No configs returned." << tcu::TestLog::EndMessage;
443 TCU_FAIL("No configs returned");
446 log << tcu::TestLog::Message << numConfigs << " configs returned" << tcu::TestLog::EndMessage;
448 EGLBoolean success = egl.chooseConfig(m_eglDisplay, &attribList[0], &config, 1, &numConfigs);
449 if (success != EGL_TRUE)
451 log << tcu::TestLog::Message << "Fail, eglChooseConfig returned an error." << tcu::TestLog::EndMessage;
452 TCU_FAIL("eglChooseConfig failed");
456 log << tcu::TestLog::Message << "Fail, more configs returned than requested." << tcu::TestLog::EndMessage;
457 TCU_FAIL("Too many configs returned");
460 EGLint components[4];
462 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_RED_SIZE, &components[0]);
463 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
465 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_GREEN_SIZE, &components[1]);
466 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
468 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_BLUE_SIZE, &components[2]);
469 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
471 success = egl.getConfigAttrib(m_eglDisplay, config, EGL_ALPHA_SIZE, &components[3]);
472 TCU_CHECK_MSG(success == EGL_TRUE, "eglGetConfigAttrib failed");
475 TCU_CHECK_MSG(components[0] == 10, "Missing 10bit deep red channel");
476 TCU_CHECK_MSG(components[1] == 10, "Missing 10bit deep green channel");
477 TCU_CHECK_MSG(components[2] == 10, "Missing 10bit deep blue channel");
478 TCU_CHECK_MSG(components[3] == 2, "Missing 2bit deep alpha channel");
480 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
483 TestCase::IterateResult WideColor1010102Test::iterate (void)
485 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
495 Iteration(float s, float i, int c)
496 : start(s), increment(i), iterationCount(c) {}
499 class WideColorSurfaceTest : public WideColorTest
502 WideColorSurfaceTest (EglTestContext& eglTestCtx,
504 const char* description,
505 const EGLint* attribList,
507 const std::vector<Iteration>& iterations);
511 void executeTest (void);
512 IterateResult iterate (void);
515 void readPixels (const glw::Functions& gl, float* dataPtr);
516 void readPixels (const glw::Functions& gl, deUint32* dataPtr);
517 void readPixels (const glw::Functions& gl, deUint8* dataPtr);
518 deUint32 expectedUint10 (float reference);
519 deUint32 expectedUint2 (float reference);
520 deUint8 expectedUint8 (float reference);
521 deUint8 expectedAlpha8 (float reference);
522 void doClearTest (EGLSurface surface);
523 void testPixels (float reference, float increment);
524 void writeEglConfig (EGLConfig config);
527 std::vector<EGLint> m_attribList;
528 EGLConfig m_eglConfig;
529 EGLint m_surfaceType;
530 EGLint m_componentType;
533 const std::vector<struct Iteration> m_iterations;
536 WideColorSurfaceTest::WideColorSurfaceTest (EglTestContext& eglTestCtx, const char* name, const char* description, const EGLint* attribList, EGLint colorSpace, const std::vector<struct Iteration>& iterations)
537 : WideColorTest (eglTestCtx, name, description)
538 , m_colorSpace (colorSpace)
539 , m_iterations (iterations)
542 while (attribList[idx] != EGL_NONE)
544 if (attribList[idx] == EGL_COLOR_COMPONENT_TYPE_EXT)
546 m_componentType = attribList[idx + 1];
548 else if (attribList[idx] == EGL_SURFACE_TYPE)
550 m_surfaceType = attribList[idx+1];
552 else if (attribList[idx] == EGL_RED_SIZE)
554 m_redSize = attribList[idx + 1];
556 m_attribList.push_back(attribList[idx++]);
557 m_attribList.push_back(attribList[idx++]);
559 m_attribList.push_back(EGL_NONE);
562 void WideColorSurfaceTest::init (void)
564 const Library& egl = m_eglTestCtx.getLibrary();
565 tcu::TestLog& log = m_testCtx.getLog();
567 WideColorTest::init();
569 EGLint numConfigs = 0;
571 // Query from EGL implementation
572 EGLU_CHECK_CALL(egl, chooseConfig(m_eglDisplay, &m_attribList[0], DE_NULL, 0, &numConfigs));
576 log << tcu::TestLog::Message << "No configs returned." << tcu::TestLog::EndMessage;
577 TCU_FAIL("No configs returned");
580 log << tcu::TestLog::Message << numConfigs << " configs returned" << tcu::TestLog::EndMessage;
582 EGLBoolean success = egl.chooseConfig(m_eglDisplay, &m_attribList[0], &m_eglConfig, 1, &numConfigs);
583 if (success != EGL_TRUE)
585 log << tcu::TestLog::Message << "Fail, eglChooseConfig returned an error." << tcu::TestLog::EndMessage;
586 TCU_FAIL("eglChooseConfig failed");
590 log << tcu::TestLog::Message << "Fail, more configs returned than requested." << tcu::TestLog::EndMessage;
591 TCU_FAIL("Too many configs returned");
594 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
596 writeEglConfig(m_eglConfig);
600 void WideColorSurfaceTest::deinit (void)
602 WideColorTest::deinit();
605 void WideColorSurfaceTest::readPixels (const glw::Functions& gl, float* dataPtr)
607 gl.readPixels(0, 0, 1, 1, GL_RGBA, GL_FLOAT, dataPtr);
608 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glReadPixels with floats");
611 void WideColorSurfaceTest::readPixels (const glw::Functions& gl, deUint32 *dataPtr)
613 gl.readPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, dataPtr);
614 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glReadPixels with RGBA_1010102 (32bits)");
617 void WideColorSurfaceTest::readPixels (const glw::Functions& gl, deUint8 *dataPtr)
619 gl.readPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, dataPtr);
620 GLU_EXPECT_NO_ERROR(m_gl.getError(), "glReadPixels with RGBA_8888 (8 bit components)");
623 void WideColorSurfaceTest::writeEglConfig (EGLConfig config)
625 const Library& egl = m_eglTestCtx.getLibrary();
626 tcu::TestLog& log = m_testCtx.getLog();
627 qpEglConfigInfo info;
630 info.bufferSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_BUFFER_SIZE);
632 info.redSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_RED_SIZE);
634 info.greenSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_GREEN_SIZE);
636 info.blueSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_BLUE_SIZE);
638 info.luminanceSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_LUMINANCE_SIZE);
640 info.alphaSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_ALPHA_SIZE);
642 info.alphaMaskSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_ALPHA_MASK_SIZE);
644 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_BIND_TO_TEXTURE_RGB);
645 info.bindToTextureRGB = val == EGL_TRUE ? true : false;
647 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_BIND_TO_TEXTURE_RGBA);
648 info.bindToTextureRGBA = val == EGL_TRUE ? true : false;
650 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_COLOR_BUFFER_TYPE);
651 std::string colorBufferType = de::toString(eglu::getColorBufferTypeStr(val));
652 info.colorBufferType = colorBufferType.c_str();
654 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_CONFIG_CAVEAT);
655 std::string caveat = de::toString(eglu::getConfigCaveatStr(val));
656 info.configCaveat = caveat.c_str();
658 info.configID = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_CONFIG_ID);
660 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_CONFORMANT);
661 std::string conformant = de::toString(eglu::getAPIBitsStr(val));
662 info.conformant = conformant.c_str();
664 info.depthSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_DEPTH_SIZE);
666 info.level = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_LEVEL);
668 info.maxPBufferWidth = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_MAX_PBUFFER_WIDTH);
670 info.maxPBufferHeight = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_MAX_PBUFFER_HEIGHT);
672 info.maxPBufferPixels = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_MAX_PBUFFER_PIXELS);
674 info.maxSwapInterval = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_MAX_SWAP_INTERVAL);
676 info.minSwapInterval = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_MIN_SWAP_INTERVAL);
678 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_NATIVE_RENDERABLE);
679 info.nativeRenderable = val == EGL_TRUE ? true : false;
681 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_RENDERABLE_TYPE);
682 std::string renderableTypes = de::toString(eglu::getAPIBitsStr(val));
683 info.renderableType = renderableTypes.c_str();
685 info.sampleBuffers = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_SAMPLE_BUFFERS);
687 info.samples = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_SAMPLES);
689 info.stencilSize = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_STENCIL_SIZE);
691 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_SURFACE_TYPE);
692 std::string surfaceTypes = de::toString(eglu::getSurfaceBitsStr(val));
693 info.surfaceTypes = surfaceTypes.c_str();
695 val = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_TRANSPARENT_TYPE);
696 std::string transparentType = de::toString(eglu::getTransparentTypeStr(val));
697 info.transparentType = transparentType.c_str();
699 info.transparentRedValue = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_TRANSPARENT_RED_VALUE);
701 info.transparentGreenValue = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_TRANSPARENT_GREEN_VALUE);
703 info.transparentBlueValue = eglu::getConfigAttribInt(egl, m_eglDisplay, config, EGL_TRANSPARENT_BLUE_VALUE);
705 log.writeEglConfig(&info);
708 deUint32 WideColorSurfaceTest::expectedUint10 (float reference)
716 else if (reference > 1.0)
722 expected = static_cast<deUint32>(deRound(reference * 1023.0));
728 deUint32 WideColorSurfaceTest::expectedUint2 (float reference)
736 else if (reference > 1.0)
742 expected = static_cast<deUint32>(deRound(reference * 3.0));
748 deUint8 WideColorSurfaceTest::expectedUint8 (float reference)
755 else if (reference >= 1.0)
761 // Apply sRGB transfer function when colorspace is sRGB and pixel component
762 // size is 8 bits (which is why we are here in expectedUint8).
763 if (m_colorSpace == EGL_GL_COLORSPACE_SRGB_KHR)
767 if (reference <= 0.0031308)
769 srgbReference = 12.92f * reference;
773 float powRef = deFloatPow(reference, (1.0f/2.4f));
774 srgbReference = (1.055f * powRef) - 0.055f;
776 expected = static_cast<deUint8>(deRound(srgbReference * 255.0));
780 expected = static_cast<deUint8>(deRound(reference * 255.0));
786 deUint8 WideColorSurfaceTest::expectedAlpha8 (float reference)
793 else if (reference >= 1.0)
799 // The sRGB transfer function is not applied to alpha
800 expected = static_cast<deUint8>(deRound(reference * 255.0));
805 void WideColorSurfaceTest::testPixels (float reference, float increment)
807 tcu::TestLog& log = m_testCtx.getLog();
809 if (m_componentType == EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT)
812 readPixels(m_gl, pixels);
814 // TODO: Do we need threshold values here? Test range
815 // and increment is chosen to exactly match FP16
817 if (pixels[0] != reference)
819 log << tcu::TestLog::Message
820 << "Image red comparison failed: "
821 << "expected = " << reference
822 << ", result = " << pixels[0]
823 << tcu::TestLog::EndMessage;
824 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
826 else if (pixels[1] != (reference + increment))
828 log << tcu::TestLog::Message
829 << "Image green comparison failed: "
830 << "expected = " << reference + increment
831 << ", result = " << pixels[1]
832 << tcu::TestLog::EndMessage;
833 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
835 else if (pixels[2] != (reference - increment))
837 log << tcu::TestLog::Message
838 << "Image blue comparison failed: "
839 << "expected = " << reference - increment
840 << ", result = " << pixels[2]
841 << tcu::TestLog::EndMessage;
842 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
844 else if (pixels[3] != (reference + 2 * increment))
846 log << tcu::TestLog::Message
847 << "Image alpha comparison failed: "
848 << "expected = " << reference + 2 * increment
849 << ", result = " << pixels[3]
850 << tcu::TestLog::EndMessage;
851 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
855 // Pixel matches expected value
858 else if (m_redSize > 8)
861 readPixels(m_gl, buffer);
864 pixels[0] = buffer[0] & 0x3ff;
865 pixels[1] = (buffer[0] >> 10) & 0x3ff;
866 pixels[2] = (buffer[0] >> 20) & 0x3ff;
867 pixels[3] = (buffer[0] >> 30) & 0x3;
869 if (pixels[0] != expectedUint10(reference))
871 log << tcu::TestLog::Message
872 << "Image red comparison failed: "
873 << "reference = " << reference
874 << ", expected = " << expectedUint10(reference)
875 << ", result = " << pixels[0]
876 << tcu::TestLog::EndMessage;
877 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
879 else if (pixels[1] != expectedUint10(reference + increment))
881 log << tcu::TestLog::Message
882 << "Image green comparison failed: "
883 << "reference = " << reference + increment
884 << ", expected = " << expectedUint10(reference + increment)
885 << ", result = " << pixels[1]
886 << tcu::TestLog::EndMessage;
887 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
889 else if (pixels[2] != expectedUint10(reference - increment))
891 log << tcu::TestLog::Message
892 << "Image blue comparison failed: "
893 << "reference = " << reference - increment
894 << ", expected = " << expectedUint10(reference - increment)
895 << ", result = " << pixels[2]
896 << tcu::TestLog::EndMessage;
897 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
899 else if (pixels[3] != expectedUint2(reference + 2 * increment))
901 log << tcu::TestLog::Message
902 << "Image alpha comparison failed: "
903 << "reference = " << reference + 2 * increment
904 << ", expected = " << expectedUint10(reference + 2 * increment)
905 << ", result = " << pixels[3]
906 << tcu::TestLog::EndMessage;
907 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
911 // Pixel matches expected value
917 readPixels(m_gl, pixels);
919 if (pixels[0] != expectedUint8(reference))
921 log << tcu::TestLog::Message
922 << "Image red comparison failed: "
923 << "reference = " << reference
924 << ", expected = " << static_cast<deUint32>(expectedUint8(reference))
925 << ", result = " << static_cast<deUint32>(pixels[0])
926 << tcu::TestLog::EndMessage;
927 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
929 else if (pixels[1] != expectedUint8(reference + increment))
931 log << tcu::TestLog::Message
932 << "Image green comparison failed: "
933 << "reference = " << reference + increment
934 << ", expected = " << static_cast<deUint32>(expectedUint8(reference + increment))
935 << ", result = " << static_cast<deUint32>(pixels[1])
936 << tcu::TestLog::EndMessage;
937 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
939 else if (pixels[2] != expectedUint8(reference - increment))
941 log << tcu::TestLog::Message
942 << "Image blue comparison failed: "
943 << "reference = " << reference - increment
944 << ", expected = " << static_cast<deUint32>(expectedUint8(reference - increment))
945 << ", result = " << static_cast<deUint32>(pixels[2])
946 << tcu::TestLog::EndMessage;
947 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
949 else if (pixels[3] != expectedAlpha8(reference + 2 * increment))
951 log << tcu::TestLog::Message
952 << "Image alpha comparison failed: "
953 << "reference = " << reference + 2 * increment
954 << ", expected = " << static_cast<deUint32>(expectedAlpha8(reference + 2 * increment))
955 << ", result = " << static_cast<deUint32>(pixels[3])
956 << tcu::TestLog::EndMessage;
957 m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Color test failed");
961 // Pixel matches expected value
966 void WideColorSurfaceTest::doClearTest (EGLSurface surface)
968 tcu::TestLog& log = m_testCtx.getLog();
969 const Library& egl = m_eglTestCtx.getLibrary();
970 const EGLint attribList[] =
972 EGL_CONTEXT_CLIENT_VERSION, 2,
975 EGLContext eglContext = egl.createContext(m_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, attribList);
976 EGLU_CHECK_MSG(egl, "eglCreateContext");
978 egl.makeCurrent(m_eglDisplay, surface, surface, eglContext);
979 EGLU_CHECK_MSG(egl, "eglMakeCurrent");
982 // put gles2Renderer inside it's own scope so that it's cleaned
983 // up before we hit the destroyContext
984 const GLES2Renderer gles2Renderer(m_gl, 128, 128);
986 std::vector<Iteration>::const_iterator it; // declare an Iterator to a vector of strings
987 log << tcu::TestLog::Message << "m_iterations.count = " << m_iterations.size() << tcu::TestLog::EndMessage;
988 for(it = m_iterations.begin() ; it < m_iterations.end(); it++)
990 float reference = it->start;
991 log << tcu::TestLog::Message << "start = " << it->start
992 << tcu::TestLog::EndMessage;
993 log << tcu::TestLog::Message
994 << "increment = " << it->increment
995 << tcu::TestLog::EndMessage;
996 log << tcu::TestLog::Message
997 << "count = " << it->iterationCount
998 << tcu::TestLog::EndMessage;
999 for (int iterationCount = 0; iterationCount < it->iterationCount; iterationCount++)
1001 const Color clearColor(reference, reference + it->increment, reference - it->increment, reference + 2 * it->increment);
1003 clearColorScreen(m_gl, clearColor);
1004 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Clear to test value");
1006 testPixels(reference, it->increment);
1008 // reset buffer contents so that we know render below did something
1009 const Color clearColor2(1.0f - reference, 1.0f, 1.0f, 1.0f);
1010 clearColorScreen(m_gl, clearColor2);
1011 GLU_EXPECT_NO_ERROR(m_gl.getError(), "Clear to 1.0f - reference value");
1013 const ColoredRect coloredRect (IVec2(0.0f, 0.0f), IVec2(1.0f, 1.0f), clearColor);
1014 gles2Renderer.render(coloredRect);
1015 testPixels(reference, it->increment);
1017 reference += it->increment;
1020 EGLU_CHECK_CALL(egl, swapBuffers(m_eglDisplay, surface));
1024 // disconnect surface & context so they can be destroyed when
1025 // this function exits.
1026 EGLU_CHECK_CALL(egl, makeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
1028 egl.destroyContext(m_eglDisplay, eglContext);
1031 void WideColorSurfaceTest::executeTest (void)
1033 tcu::TestLog& log = m_testCtx.getLog();
1034 const Library& egl = m_eglTestCtx.getLibrary();
1035 const eglu::NativeDisplayFactory& displayFactory = m_eglTestCtx.getNativeDisplayFactory();
1036 eglu::NativeDisplay& nativeDisplay = m_eglTestCtx.getNativeDisplay();
1037 egl.bindAPI(EGL_OPENGL_ES_API);
1039 if (m_surfaceType & EGL_PBUFFER_BIT)
1041 log << tcu::TestLog::Message << "Test Pbuffer" << tcu::TestLog::EndMessage;
1043 std::vector<EGLint> attribs;
1044 attribs.push_back(EGL_WIDTH);
1045 attribs.push_back(128);
1046 attribs.push_back(EGL_HEIGHT);
1047 attribs.push_back(128);
1050 attribs.push_back(EGL_GL_COLORSPACE_KHR);
1051 attribs.push_back(m_colorSpace);
1053 attribs.push_back(EGL_NONE);
1054 attribs.push_back(EGL_NONE);
1055 const EGLSurface surface = egl.createPbufferSurface(m_eglDisplay, m_eglConfig, attribs.data());
1056 TCU_CHECK(surface != EGL_NO_SURFACE);
1057 EGLU_CHECK_MSG(egl, "eglCreatePbufferSurface()");
1059 doClearTest(surface);
1061 egl.destroySurface(m_eglDisplay, surface);
1062 EGLU_CHECK_MSG(egl, "eglDestroySurface()");
1064 else if (m_surfaceType & EGL_WINDOW_BIT)
1066 log << tcu::TestLog::Message << "Test Window" << tcu::TestLog::EndMessage;
1068 const eglu::NativeWindowFactory& windowFactory = eglu::selectNativeWindowFactory(displayFactory, m_testCtx.getCommandLine());
1070 de::UniquePtr<eglu::NativeWindow> window (windowFactory.createWindow(&nativeDisplay, m_eglDisplay, m_eglConfig, DE_NULL, eglu::WindowParams(128, 128, eglu::parseWindowVisibility(m_testCtx.getCommandLine()))));
1071 std::vector<EGLAttrib> attribs;
1074 attribs.push_back(EGL_GL_COLORSPACE_KHR);
1075 attribs.push_back(m_colorSpace);
1077 attribs.push_back(EGL_NONE);
1078 attribs.push_back(EGL_NONE);
1080 const EGLSurface surface = eglu::createWindowSurface(nativeDisplay, *window, m_eglDisplay, m_eglConfig, attribs.data());
1081 TCU_CHECK(surface != EGL_NO_SURFACE);
1082 EGLU_CHECK_MSG(egl, "eglCreateWindowSurface()");
1084 doClearTest(surface);
1086 egl.destroySurface(m_eglDisplay, surface);
1087 EGLU_CHECK_MSG(egl, "eglDestroySurface()");
1089 else if (m_surfaceType & EGL_PIXMAP_BIT)
1091 log << tcu::TestLog::Message << "Test Pixmap" << tcu::TestLog::EndMessage;
1093 const eglu::NativePixmapFactory& pixmapFactory = eglu::selectNativePixmapFactory(displayFactory, m_testCtx.getCommandLine());
1095 de::UniquePtr<eglu::NativePixmap> pixmap (pixmapFactory.createPixmap(&nativeDisplay, m_eglDisplay, m_eglConfig, DE_NULL, 128, 128));
1096 const EGLSurface surface = eglu::createPixmapSurface(nativeDisplay, *pixmap, m_eglDisplay, m_eglConfig, DE_NULL);
1097 TCU_CHECK(surface != EGL_NO_SURFACE);
1098 EGLU_CHECK_MSG(egl, "eglCreatePixmapSurface()");
1100 doClearTest(surface);
1102 egl.destroySurface(m_eglDisplay, surface);
1103 EGLU_CHECK_MSG(egl, "eglDestroySurface()");
1106 TCU_FAIL("No valid surface types supported in config");
1109 TestCase::IterateResult WideColorSurfaceTest::iterate (void)
1111 m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
1118 WideColorTests::WideColorTests (EglTestContext& eglTestCtx)
1119 : TestCaseGroup(eglTestCtx, "wide_color", "Wide Color tests")
1123 void WideColorTests::init (void)
1125 addChild(new WideColorFP16Test(m_eglTestCtx, "fp16", "Verify that FP16 pixel format is present"));
1126 addChild(new WideColor1010102Test(m_eglTestCtx, "1010102", "Verify that 1010102 pixel format is present"));
1128 // This is an increment FP16 can do between -1.0 to 1.0
1129 const float fp16Increment1 = deFloatPow(2.0, -11.0);
1130 // This is an increment FP16 can do between 1.0 to 2.0
1131 const float fp16Increment2 = deFloatPow(2.0, -10.0);
1133 const EGLint windowAttribListFP16[] =
1135 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
1136 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1141 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT,
1145 std::vector<Iteration> fp16Iterations;
1146 // -0.333251953125f ~ -1/3 as seen in FP16
1147 fp16Iterations.push_back(Iteration(-0.333251953125f, fp16Increment1, 10));
1149 fp16Iterations.push_back( Iteration(-fp16Increment1 * 5.0f, fp16Increment1, 10));
1150 // test crossing 1.0
1151 fp16Iterations.push_back( Iteration(1.0f - fp16Increment2 * 5.0f, fp16Increment2, 10));
1152 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_fp16_default_colorspace", "FP16 window surface has FP16 pixels in it", windowAttribListFP16, DE_NULL, fp16Iterations));
1153 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_fp16_colorspace_srgb", "FP16 window surface, explicit sRGB colorspace", windowAttribListFP16, EGL_GL_COLORSPACE_SRGB_KHR, fp16Iterations));
1154 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_fp16_colorspace_p3", "FP16 window surface, explicit Display-P3 colorspace", windowAttribListFP16, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, fp16Iterations));
1155 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_fp16_colorspace_scrgb", "FP16 window surface, explicit scRGB colorspace", windowAttribListFP16, EGL_GL_COLORSPACE_SCRGB_EXT, fp16Iterations));
1156 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_fp16_colorspace_scrgb_linear", "FP16 window surface, explicit scRGB linear colorspace", windowAttribListFP16, EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT, fp16Iterations));
1158 const EGLint pbufferAttribListFP16[] =
1160 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
1161 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1166 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT,
1169 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_fp16_default_colorspace", "FP16 pbuffer surface has FP16 pixels in it", pbufferAttribListFP16, DE_NULL, fp16Iterations));
1170 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_fp16_colorspace_srgb", "FP16 pbuffer surface, explicit sRGB colorspace", pbufferAttribListFP16, EGL_GL_COLORSPACE_SRGB_KHR, fp16Iterations));
1171 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_fp16_colorspace_p3", "FP16 pbuffer surface, explicit Display-P3 colorspace", pbufferAttribListFP16, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, fp16Iterations));
1172 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_fp16_colorspace_scrgb", "FP16 pbuffer surface, explicit scRGB colorspace", pbufferAttribListFP16, EGL_GL_COLORSPACE_SCRGB_EXT, fp16Iterations));
1173 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_fp16_colorspace_scrgb_linear", "FP16 pbuffer surface, explicit scRGB linear colorspace", pbufferAttribListFP16, EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT, fp16Iterations));
1175 const EGLint windowAttribList1010102[] =
1177 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
1178 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1183 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,
1187 std::vector<Iteration> int1010102Iterations;
1188 // -0.333251953125f ~ -1/3 as seen in fp16
1189 // Negative values will be 0 on read with fixed point pixel formats
1190 int1010102Iterations.push_back(Iteration(-0.333251953125f, fp16Increment1, 10));
1192 int1010102Iterations.push_back(Iteration(-fp16Increment1 * 5.0f, fp16Increment1, 10));
1193 // test crossing 1.0
1194 // Values > 1.0 will be truncated to 1.0 with fixed point pixel formats
1195 int1010102Iterations.push_back(Iteration(1.0f - fp16Increment2 * 5.0f, fp16Increment2, 10));
1196 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_1010102_colorspace_default", "1010102 Window surface, default (sRGB) colorspace", windowAttribList1010102, DE_NULL, int1010102Iterations));
1197 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_1010102_colorspace_srgb", "1010102 Window surface, explicit sRGB colorspace", windowAttribList1010102, EGL_GL_COLORSPACE_SRGB_KHR, int1010102Iterations));
1198 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_1010102_colorspace_p3", "1010102 Window surface, explicit Display-P3 colorspace", windowAttribList1010102, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, int1010102Iterations));
1200 const EGLint pbufferAttribList1010102[] =
1202 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
1203 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1208 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,
1211 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_1010102_colorspace_default", "1010102 pbuffer surface, default (sRGB) colorspace", pbufferAttribList1010102, DE_NULL, int1010102Iterations));
1212 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_1010102_colorspace_srgb", "1010102 pbuffer surface, explicit sRGB colorspace", pbufferAttribList1010102, EGL_GL_COLORSPACE_SRGB_KHR, int1010102Iterations));
1213 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_1010102_colorspace_p3", "1010102 pbuffer surface, explicit Display-P3 colorspace", pbufferAttribList1010102, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, int1010102Iterations));
1215 const EGLint windowAttribList8888[] =
1217 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
1218 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1223 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,
1227 std::vector<Iteration> int8888Iterations;
1228 // -0.333251953125f ~ -1/3 as seen in fp16
1229 // Negative values will be 0 on read with fixed point pixel formats
1230 int8888Iterations.push_back(Iteration(-0.333251953125f, fp16Increment1, 10));
1232 int8888Iterations.push_back(Iteration(-fp16Increment1 * 5.0f, fp16Increment1, 10));
1233 // test crossing 1.0
1234 // Values > 1.0 will be truncated to 1.0 with fixed point pixel formats
1235 int8888Iterations.push_back(Iteration(1.0f - fp16Increment2 * 5.0f, fp16Increment2, 10));
1236 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_8888_colorspace_default", "8888 window surface, default (sRGB) colorspace", windowAttribList8888, DE_NULL, int8888Iterations));
1237 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_8888_colorspace_srgb", "8888 window surface, explicit sRGB colorspace", windowAttribList8888, EGL_GL_COLORSPACE_SRGB_KHR, int8888Iterations));
1238 addChild(new WideColorSurfaceTest(m_eglTestCtx, "window_8888_colorspace_p3", "8888 window surface, explicit Display-P3 colorspace", windowAttribList8888, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, int8888Iterations));
1240 const EGLint pbufferAttribList8888[] =
1242 EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
1243 EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
1248 EGL_COLOR_COMPONENT_TYPE_EXT, EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,
1251 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_8888_colorspace_default", "8888 pbuffer surface, default (sRGB) colorspace", pbufferAttribList8888, DE_NULL, int8888Iterations));
1252 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_8888_colorspace_srgb", "8888 pbuffer surface, explicit sRGB colorspace", pbufferAttribList8888, EGL_GL_COLORSPACE_SRGB_KHR, int8888Iterations));
1253 addChild(new WideColorSurfaceTest(m_eglTestCtx, "pbuffer_8888_colorspace_p3", "8888 pbuffer surface, explicit Display-P3 colorspace", pbufferAttribList8888, EGL_GL_COLORSPACE_DISPLAY_P3_EXT, int8888Iterations));
1256 TestCaseGroup* createWideColorTests (EglTestContext& eglTestCtx)
1258 return new WideColorTests(eglTestCtx);