diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-07-03 12:15:46 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-07-04 17:39:45 +0200 |
commit | 92658ebb755bda136a7e4fa455b8d116c2dd0c6f (patch) | |
tree | 60c346fa4921a8be7448f550ebda033c07e21d49 /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | |
parent | 48dcabdb6f30d5e0c05fc1e56bb4ed4e3a96514c (diff) |
Verbose fatal instead of crash when the scene graph state is invalid.
Change-Id: I9a55bcbf9e94084c0cadac561e4707d47f5f8744
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 3770461ba7..0ae0c1579b 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -56,6 +56,7 @@ #include <QtGui/QOpenGLFunctions_1_0> #include <private/qquickprofiler_p.h> +#include "qsgmaterialshader_p.h" #include <algorithm> @@ -2058,6 +2059,19 @@ void Renderer::renderMergedBatch(const Batch *batch) program->updateState(state(dirty), material, m_currentMaterial); +#ifndef QT_NO_DEBUG + if (qsg_test_and_clear_material_failure()) { + qDebug() << "QSGMaterial::updateState triggered an error (merged), batch will be skipped:"; + Element *ee = e; + while (ee) { + qDebug() << " -" << ee->node; + ee = ee->nextInBatch; + } + QSGNodeDumper::dump(rootNode()); + qFatal("Aborting: scene graph is invalid..."); + } +#endif + m_currentMaterial = material; QSGGeometry* g = gn->geometry(); @@ -2165,6 +2179,16 @@ void Renderer::renderUnmergedBatch(const Batch *batch) program->updateState(state(dirty), material, m_currentMaterial); +#ifndef QT_NO_DEBUG + if (qsg_test_and_clear_material_failure()) { + qDebug() << "QSGMaterial::updateState() triggered an error (unmerged), batch will be skipped:"; + qDebug() << " - offending node is" << e->node; + QSGNodeDumper::dump(rootNode()); + qFatal("Aborting: scene graph is invalid..."); + return; + } +#endif + // We don't need to bother with asking each node for its material as they // are all identical (compare==0) since they are in the same batch. m_currentMaterial = material; |