From b60ae978ad046934d2dc6372da1703329456840d Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Fri, 12 Jan 2018 16:21:00 -0500 Subject: [PATCH] Handle unsupported no_config contexts EGL_KHR_no_config_context doesn't mandate support for ES 1.1 or for GL versions prior to 3.0. Update the test to handle optional support, and also update the GL version to 3.0 in order to test a case which is expected to work. Bug: b/72041864 Components: AOSP Test: dEQP-EGL.functional.create_context.no_config Change-Id: Ibe7856000c67326fe23cd024435290fba536d127 --- modules/egl/teglCreateContextTests.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/egl/teglCreateContextTests.cpp b/modules/egl/teglCreateContextTests.cpp index b107d67..663efc4 100644 --- a/modules/egl/teglCreateContextTests.cpp +++ b/modules/egl/teglCreateContextTests.cpp @@ -40,6 +40,7 @@ using std::vector; using tcu::TestLog; using namespace eglw; +static const EGLint s_glAttrs[] = { EGL_CONTEXT_MAJOR_VERSION_KHR, 3, EGL_NONE }; static const EGLint s_es1Attrs[] = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE }; static const EGLint s_es2Attrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; static const EGLint s_es3Attrs[] = { EGL_CONTEXT_MAJOR_VERSION_KHR, 3, EGL_NONE }; @@ -49,14 +50,15 @@ static const struct const char* name; EGLenum api; EGLint apiBit; + bool noConfigOptional; const EGLint* ctxAttrs; } s_apis[] = { - { "OpenGL", EGL_OPENGL_API, EGL_OPENGL_BIT, DE_NULL }, - { "OpenGL ES 1", EGL_OPENGL_ES_API, EGL_OPENGL_ES_BIT, s_es1Attrs }, - { "OpenGL ES 2", EGL_OPENGL_ES_API, EGL_OPENGL_ES2_BIT, s_es2Attrs }, - { "OpenGL ES 3", EGL_OPENGL_ES_API, EGL_OPENGL_ES3_BIT_KHR, s_es3Attrs }, - { "OpenVG", EGL_OPENVG_API, EGL_OPENVG_BIT, DE_NULL } + { "OpenGL", EGL_OPENGL_API, EGL_OPENGL_BIT, false, s_glAttrs }, + { "OpenGL ES 1", EGL_OPENGL_ES_API, EGL_OPENGL_ES_BIT, true, s_es1Attrs }, + { "OpenGL ES 2", EGL_OPENGL_ES_API, EGL_OPENGL_ES2_BIT, true, s_es2Attrs }, + { "OpenGL ES 3", EGL_OPENGL_ES_API, EGL_OPENGL_ES3_BIT_KHR, false, s_es3Attrs }, + { "OpenVG", EGL_OPENVG_API, EGL_OPENVG_BIT, false, DE_NULL } }; class CreateContextCase : public SimpleConfigCase @@ -146,7 +148,11 @@ public: const EGLContext context = egl.createContext(*display, (EGLConfig)0, EGL_NO_CONTEXT, s_apis[apiNdx].ctxAttrs); const EGLenum err = egl.getError(); - if (context == EGL_NO_CONTEXT || err != EGL_SUCCESS) + if (context == EGL_NO_CONTEXT && err == EGL_BAD_MATCH && s_apis[apiNdx].noConfigOptional) + { + log << TestLog::Message << " Unsupported" << TestLog::EndMessage; + } + else if (context == EGL_NO_CONTEXT || err != EGL_SUCCESS) { log << TestLog::Message << " Fail, context: " << tcu::toHex(context) << ", error: " << eglu::getErrorName(err) << TestLog::EndMessage; m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Failed to create context"); -- 2.7.4