From ab92855a4f18d926706554186f80d4c15b65b319 Mon Sep 17 00:00:00 2001 From: Jason Erb Date: Thu, 24 Sep 2015 13:55:39 -0400 Subject: Fixed assertion failure when using QSG_RENDERER_DEBUG=upload Added a check that Batch::drawSets is not empty. Task-number: QTBUG-48439 Change-Id: Ica76363be8c770240dc69c669815a60904e26988 Reviewed-by: Gunnar Sletta (cherry picked from commit 893a4ffd6476a11597f9dd3c847fe3db4bf38eed) Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Jason Erb (Suitable Technologies) --- src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp index 45fb857fb3..35eacd1f9b 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp @@ -1950,25 +1950,27 @@ void Renderer::uploadBatch(Batch *b) vd += g->sizeOfVertex(); } - const quint16 *id = + if (!b->drawSets.isEmpty()) { + const quint16 *id = # ifdef QSG_SEPARATE_INDEX_BUFFER (const quint16 *) (b->ibo.data); # else (const quint16 *) (b->vbo.data + b->drawSets.at(0).indices); # endif - { - QDebug iDump = qDebug(); - iDump << " -- Index Data, count:" << b->indexCount; - for (int i=0; iindexCount; ++i) { - if ((i % 24) == 0) - iDump << endl << " --- "; - iDump << id[i]; + { + QDebug iDump = qDebug(); + iDump << " -- Index Data, count:" << b->indexCount; + for (int i=0; iindexCount; ++i) { + if ((i % 24) == 0) + iDump << endl << " --- "; + iDump << id[i]; + } } - } - for (int i=0; idrawSets.size(); ++i) { - const DrawSet &s = b->drawSets.at(i); - qDebug() << " -- DrawSet: indexCount:" << s.indexCount << " vertices:" << s.vertices << " z:" << s.zorders << " indices:" << s.indices; + for (int i=0; idrawSets.size(); ++i) { + const DrawSet &s = b->drawSets.at(i); + qDebug() << " -- DrawSet: indexCount:" << s.indexCount << " vertices:" << s.vertices << " z:" << s.zorders << " indices:" << s.indices; + } } } #endif // QT_NO_DEBUG_OUTPUT -- cgit v1.2.3