Commit e6d2bc15 authored by Erik Kurzinger's avatar Erik Kurzinger
Browse files

platforms/drm: set read buffer in GbmSurface::makeContextCurrent

The first time the GBM backend's EGL context is made current after
creation, both the read and draw surfaces are set to EGL_NO_SURFACE.
This will set the GL read and draw buffers to GL_NONE in accordance with
the EGL spec.

When a real surface is later made current, however, the spec is arguably
unclear on whether the read and draw buffers should remain set to
GL_NONE or whether they should be restored to the default GL_BACK.  The
Mesa driver does the latter, the NVIDIA driver does the former.

To work around this difference, Kwin has an explicit call to
glDrawBuffer in GbmSurface::makeContextCurrent. It does not have a
corresponding call to glReadBuffer, though, which can cause some desktop
effects such as background contrast to render incorrectly with the
NVIDIA driver. This change adds that missing call.
parent 35c36be1
Pipeline #173667 passed with stage
in 17 minutes and 47 seconds
......@@ -75,6 +75,7 @@ bool GbmSurface::makeContextCurrent() const
}
if (!GLPlatform::instance()->isGLES()) {
glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
}
return true;
}
......
Supports Markdown
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