From cd585972aeb16ed09a0812ffa35aa438f436bc00 Mon Sep 17 00:00:00 2001 From: Philipp Knechtges Date: Thu, 1 Dec 2011 22:41:10 +0100 Subject: [PATCH] kwin: avoid SEGFAULT in case of egl_glx The mesa egl_glx egl driver only provides indirect rendering which is insufficient for GLES2. --- compositingprefs.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compositingprefs.cpp b/compositingprefs.cpp index e5ec647490..4a7f9b89c7 100644 --- a/compositingprefs.cpp +++ b/compositingprefs.cpp @@ -310,6 +310,12 @@ bool CompositingPrefs::initEGLContext() EGLConfig configs[1024]; eglChooseConfig(mEGLDisplay, config_attribs, configs, 1024, &count); + if (count == 0) { + // egl_glx only supports indirect rendering, which itself does not allow GLES2 + kWarning(1212) << "You might be using mesa egl_glx, which is not supported!"; + return false; + } + EGLint visualId = XVisualIDFromVisual((Visual*)QX11Info::appVisual()); EGLConfig config = configs[0];