Commit dabc7d8b authored by Adam Jackson's avatar Adam Jackson 🎧 Committed by Adam Jackson
Browse files

xwayland: Fall back to GLES2 if we don't get at least GL 2.1 in glamor

Some particularly unfortunate hardware (Intel gen3, mostly) will give
you GLES2 but not GL 2.1. Fall back to GLES2 for such cases so you still
get accelerated GLX.
parent 741bd734
Pipeline #76422 passed with stages
in 4 minutes and 40 seconds
......@@ -948,6 +948,21 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, NULL);
}
/* glamor needs either big-GL 2.1 or GLES2 */
if (xwl_screen->egl_context && epoxy_gl_version() < 21) {
const EGLint gles_attribs[] = {
EGL_CONTEXT_CLIENT_VERSION,
2,
EGL_NONE,
};
eglDestroyContext(xwl_screen->egl_display, xwl_screen->egl_context);
eglBindAPI(EGL_OPENGL_ES_API);
xwl_screen->egl_context = eglCreateContext(xwl_screen->egl_display,
NULL, EGL_NO_CONTEXT,
gles_attribs);
}
if (xwl_screen->egl_context == EGL_NO_CONTEXT) {
ErrorF("Failed to create EGL context\n");
goto error;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment