diff options
author | Jason Erb <erb@suitabletech.com> | 2015-09-24 13:55:39 -0400 |
---|---|---|
committer | Jason Erb (Suitable Technologies) <erb@suitabletech.com> | 2017-05-04 12:42:31 +0000 |
commit | ab92855a4f18d926706554186f80d4c15b65b319 (patch) | |
tree | db64d7096f4c22f28dd36da9f66616cfd4d6f6db | |
parent | 2da8e40fe22396eec158c160ac75ab23d4a0abd8 (diff) |
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 <gunnar@sletta.org>
(cherry picked from commit 893a4ffd6476a11597f9dd3c847fe3db4bf38eed)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Jason Erb (Suitable Technologies) <erb@suitabletech.com>
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp | 26 |
1 files 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; i<b->indexCount; ++i) { - if ((i % 24) == 0) - iDump << endl << " --- "; - iDump << id[i]; + { + QDebug iDump = qDebug(); + iDump << " -- Index Data, count:" << b->indexCount; + for (int i=0; i<b->indexCount; ++i) { + if ((i % 24) == 0) + iDump << endl << " --- "; + iDump << id[i]; + } } - } - for (int i=0; i<b->drawSets.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; i<b->drawSets.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 |