Fix EGL_CONTEXT_CLIENT_VERSION check.
authorMika Isojärvi <misojarvi@google.com>
Fri, 24 Oct 2014 07:58:07 +0000 (10:58 +0300)
committerPyry Haulos <phaulos@google.com>
Tue, 11 Nov 2014 16:52:33 +0000 (16:52 +0000)
Check that EGL_CONTEXT_CLIENT_VERSION is version that supports version
used when creating context instead of requiring it to be exactly same.

Bug: 18329517
Change-Id: I072a5796d92450b29e82655ea840c3b67ec8eea9
(cherry picked from commit 2b5718821a9ec271f25bcac0569c6e1c2dcf33eb)

modules/egl/teglQueryContextTests.cpp

index c6edb9d..3f3fe2b 100644 (file)
@@ -404,7 +404,8 @@ public:
                {
                        const EGLint    clientVersion   = getContextAttrib(display, context, EGL_CONTEXT_CLIENT_VERSION);
 
-                       if (info.clientType == EGL_OPENGL_ES_API && clientVersion != info.clientVersion)
+                       // \todo [2014-10-21 mika] Query actual supported api version from client api to make this check stricter.
+                       if (info.clientType == EGL_OPENGL_ES_API && ((info.clientVersion == 1 && clientVersion != 1) || clientVersion < info.clientVersion))
                        {
                                log << TestLog::Message << "  Fail, client API version doesn't match." << TestLog::EndMessage;
                                m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid client API version");