From ae80fa4731b729d7e546af212d08a93a555ff3c1 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 25 Oct 2019 22:03:18 +1100 Subject: [PATCH] qmlglsrc: read from the back buffer when use-default-fbo = TRUE glReadBuffer(GL_COLOR_ATTACHMENT0) on the default framebuffer (0) is invalid GL API usage and would result in a GL error being thrown. --- ext/qt/qtwindow.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/qt/qtwindow.cc b/ext/qt/qtwindow.cc index 2143ab57e7..9360c3337f 100644 --- a/ext/qt/qtwindow.cc +++ b/ext/qt/qtwindow.cc @@ -242,14 +242,17 @@ QtGLWindow::afterRendering() GST_ERROR ("FBO errors"); goto errors; } - gl->ReadBuffer (GL_COLOR_ATTACHMENT0); + if (this->priv->useDefaultFbo) + gl->ReadBuffer (GL_BACK); + else + gl->ReadBuffer (GL_COLOR_ATTACHMENT0); gl->BlitFramebuffer (0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_LINEAR); } else { gl->CopyTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, width, height, 0); } - + GST_DEBUG ("rendering finished"); errors: