Check for GLES 3.0 Context Before Using 3.0 Functionality
authorTim Van Patten <timvp@google.com>
Tue, 9 Apr 2019 20:41:16 +0000 (14:41 -0600)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 6 May 2019 07:53:31 +0000 (03:53 -0400)
The additional testFramebufferColorEncoding() testing requires a GLES
3.0 context, but only a 2.0 context is requested.   This change will
continue to execute those tests, but only after verifying a 3.0 context
was returned.

Affects:
dEQP-EGL.functional.wide_color.window_fp16_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.pbuffer_fp16_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.window_1010102_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.pbuffer_1010102_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.window_8888_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.window_888_colorspace_p3_passthrough
dEQP-EGL.functional.wide_color.pbuffer_888_colorspace_p3_passthrough

Components: EGL

Bug: 1704
Google Bug: 124910588

Change-Id: Ifc81308c569923d4d777cd5c5329568b579f1ac1

modules/egl/teglWideColorTests.cpp

index 16be114a1e76e0a8cefbe57406945572b6611a8c..c05378905105982e745386eca70c0da572a79005 100644 (file)
@@ -1194,7 +1194,15 @@ void WideColorSurfaceTest::doClearTest (EGLSurface surface)
 
                                reference += it->increment;
 
-                               testFramebufferColorEncoding();
+                               // Detect compatible GLES context by querying GL_MAJOR_VERSION.
+                               // This query does not exist on GLES2 so succeeding query implies GLES3+ context.
+                               glw::GLint majorVersion = 0;
+                               m_gl.getIntegerv(GL_MAJOR_VERSION, &majorVersion);
+                               if (m_gl.getError() == GL_NO_ERROR)
+                               {
+                                       // This device is ES3 compatible, so do some additional testing
+                                       testFramebufferColorEncoding();
+                               }
                        }
 
                        EGLU_CHECK_CALL(egl, swapBuffers(m_eglDisplay, surface));