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
This commit is contained in:
Adam Jackson 2019-10-29 11:53:27 -04:00 committed by Jonas Ådahl
parent 7c036c5896
commit f4f7e31303

View File

@ -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,