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.
This commit is contained in:
Matthew Waters 2019-10-25 22:03:18 +11:00
parent 7f1e1d0d9d
commit ae80fa4731

View file

@ -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: