summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer.cpp b/src/platformsupport/eglconvenience/qeglpbuffer.cpp
index 9cdf5a0931..756609a641 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer.cpp
+++ b/src/platformsupport/eglconvenience/qeglpbuffer.cpp
@@ -55,7 +55,18 @@ QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffs
, m_display(display)
, m_pbuffer(EGL_NO_SURFACE)
{
- if (q_hasEglExtension(display, "EGL_KHR_surfaceless_context"))
+ bool hasSurfaceless = q_hasEglExtension(display, "EGL_KHR_surfaceless_context");
+
+ // Disable surfaceless contexts on Mesa for now. As of 10.6.0 and Intel at least, some
+ // operations (glReadPixels) are unable to work without a surface since they at some
+ // point temporarily unbind the current FBO and then later blow up in some seemingly
+ // safe operations, like setting the viewport, that apparently need access to the
+ // read/draw surface in the Intel backend.
+ const char *vendor = eglQueryString(display, EGL_VENDOR); // hard to check for GL_ strings here, so blacklist all Mesa
+ if (vendor && strstr(vendor, "Mesa"))
+ hasSurfaceless = false;
+
+ if (hasSurfaceless)
return;
EGLConfig config = q_configFromGLFormat(m_display, m_format, false, EGL_PBUFFER_BIT);