From 2414f1675eab163b22dcc4e8ded80ed04d06369b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 23 May 2014 10:27:49 +0200 Subject: Keep the internal state about the bound fbo up to date When binding an FBO directly via glBindFramebuffer, the QOpenGLContext's internal current_fbo, that is maintained by QOpenGLFramebufferObject, becomes out of sync. This will lead to QOpenGLFramebufferObjects thinking they are still bound. This fix prevents ShaderEffect items in QQuickWidget from complaining about "'recursive' must be set to true when rendering recursively". Ideally the entire tracking of the current fbo should be removed, since it cannot be done robustly enough, but that will likely happen in 5.4 only. Task-number: QTBUG-38994 Change-Id: I39015d90bb2e0985d2a084b79ffe2004a9bc9f07 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/coreapi/qsgrenderer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index cc8793c0cf..a4e122ec91 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -103,7 +103,9 @@ QSGBindableFboId::QSGBindableFboId(GLuint id) void QSGBindableFboId::bind() const { - QOpenGLContext::currentContext()->functions()->glBindFramebuffer(GL_FRAMEBUFFER, m_id); + QOpenGLContext *context = QOpenGLContext::currentContext(); + context->functions()->glBindFramebuffer(GL_FRAMEBUFFER, m_id); + QOpenGLContextPrivate::get(context)->current_fbo = m_id; } /*! -- cgit v1.2.3