[mutter] cogl: Fix GLES2 fallback



commit f4f7e31303d78b2a8a0881b61311b8d750301b8f
Author: Adam Jackson <ajax redhat com>
Date:   Tue Oct 29 11:53:27 2019 -0400

    cogl: Fix GLES2 fallback
    
    Say you're using intel gen3, you poor soul. Your big-GL maxes out at 1.5
    unless you use dirty tricks, but you do have GLES2. We try to fall back
    to GLES in this case, but we only ever say eglBindAPI(EGL_OPENGL_API).
    So when we go to do CreateContext, even though we think we've requested
    GLES 2.0, the driver will compare that "2.0" against the maximum big-GL
    version, and things will fail.
    
    Fix this by binding EGL_OPENGL_ES_API before trying a GLES context.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/635

 cogl/cogl/winsys/cogl-winsys-egl.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
index 99dcb8bf3..f2b439a67 100644
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
@@ -329,6 +329,8 @@ try_create_context (CoglDisplay *display,
   if (renderer->driver == COGL_DRIVER_GL ||
       renderer->driver == COGL_DRIVER_GL3)
     eglBindAPI (EGL_OPENGL_API);
+  else if (renderer->driver == COGL_DRIVER_GLES2)
+    eglBindAPI (EGL_OPENGL_ES_API);
 
   egl_attributes_from_framebuffer_config (display,
                                           &display->onscreen_template->config,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]