Introduce QML_FBO_FLUSH_BEFORE_DETACH to work around FBO issue.
authorMichael Brasser <michael.brasser@live.com>
Tue, 5 Mar 2013 02:20:15 +0000 (20:20 -0600)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 12 Mar 2013 11:42:49 +0000 (12:42 +0100)
On some AMD hardware, detaching the depth attachment immediately after
rendering to an FBO will cause rendering issues. Adding an explicit
glFlush before detaching seems to work around the issue.

Task-number: QTBUG-29265
Change-Id: I97c7b87c1c3d3a69a4d6228dd9459745710c5f4c
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
src/quick/items/qquickshadereffectsource.cpp

index bdfef7c..cab3692 100644 (file)
@@ -53,6 +53,7 @@
 QT_BEGIN_NAMESPACE
 
 DEFINE_BOOL_CONFIG_OPTION(qmlFboOverlay, QML_FBO_OVERLAY)
+DEFINE_BOOL_CONFIG_OPTION(qmlFboFlushBeforeDetach, QML_FBO_FLUSH_BEFORE_DETACH)
 
 namespace
 {
@@ -75,6 +76,8 @@ namespace
 
     BindableFbo::~BindableFbo()
     {
+        if (qmlFboFlushBeforeDetach())
+            glFlush();
         if (m_depthStencil)
             m_depthStencil->detach();
     }