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>
QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlFboOverlay, QML_FBO_OVERLAY)
+DEFINE_BOOL_CONFIG_OPTION(qmlFboFlushBeforeDetach, QML_FBO_FLUSH_BEFORE_DETACH)
namespace
{
BindableFbo::~BindableFbo()
{
+ if (qmlFboFlushBeforeDetach())
+ glFlush();
if (m_depthStencil)
m_depthStencil->detach();
}