From 340bb23f2193e1866c9571b257a1b76185909e82 Mon Sep 17 00:00:00 2001 From: Pablo Ceballos Date: Wed, 18 May 2016 16:11:26 -0700 Subject: [PATCH] Check configs before mutable_render_buffer negative test Some implementations don't expose any configs without support for mutable render buffer. Don't test those. Bug 27129258 Change-Id: I5186630ac81abc31002881c092d9ca50607eb1c4 --- modules/egl/teglMutableRenderBufferTests.cpp | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/modules/egl/teglMutableRenderBufferTests.cpp b/modules/egl/teglMutableRenderBufferTests.cpp index 2fd036b..d004a79 100644 --- a/modules/egl/teglMutableRenderBufferTests.cpp +++ b/modules/egl/teglMutableRenderBufferTests.cpp @@ -36,6 +36,8 @@ using namespace eglw; +using std::vector; + namespace deqp { namespace egl @@ -119,9 +121,30 @@ void MutableRenderBufferTest::init (void) EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; - m_eglConfig = m_enableConfigBit ? - eglu::chooseSingleConfig(egl, m_eglDisplay, attribs) : - eglu::chooseSingleConfig(egl, m_eglDisplay, attribsNoBit); + + if (m_enableConfigBit) + { + m_eglConfig = eglu::chooseSingleConfig(egl, m_eglDisplay, attribs); + } + else + { + const vector configs = eglu::chooseConfigs(egl, m_eglDisplay, attribsNoBit); + + for (vector::const_iterator config = configs.begin(); config != configs.end(); ++config) + { + EGLint surfaceType = -1; + EGLU_CHECK_CALL(egl, getConfigAttrib(m_eglDisplay, *config, EGL_SURFACE_TYPE, &surfaceType)); + + if (!(surfaceType & EGL_MUTABLE_RENDER_BUFFER_BIT_KHR)) + { + m_eglConfig = *config; + break; + } + } + + if (m_eglConfig == DE_NULL) + TCU_THROW(NotSupportedError, "No config without support for mutable_render_buffer found"); + } // create surface const eglu::NativeWindowFactory& factory = eglu::selectNativeWindowFactory(m_eglTestCtx.getNativeDisplayFactory(), m_testCtx.getCommandLine()); -- 2.7.4