backends/drm: work around llvmpipe implicit sync not working

implicit sync doesn't work properly with glFlush + KMS and llvmpipe doesn't support
EGL_ANDROID_native_fence_sync either, so we need to wait for rendering to complete
in a blocking fashion.
This commit is contained in:
Xaver Hugl 2023-07-17 10:15:56 +02:00
parent 72aad0881d
commit f43e45c984

View file

@ -143,6 +143,10 @@ bool EglGbmLayerSurface::endRendering(const QRegion &damagedRegion)
m_surface.gbmSwapchain->release(m_surface.currentSlot);
m_surface.timeQuery->end();
glFlush();
if (m_eglBackend->contextObject()->isSoftwareRenderer()) {
// llvmpipe doesn't do synchronization properly: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9375
glFinish();
}
const auto buffer = importBuffer(m_surface, m_surface.currentSlot.get());
m_surface.renderEnd = std::chrono::steady_clock::now();
if (buffer) {