aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
diff options
context:
space:
mode:
authorJason Erb <erb@suitabletech.com>2015-09-24 13:55:39 -0400
committerJason Erb <erb@suitabletech.com>2015-12-31 01:47:13 +0000
commit893a4ffd6476a11597f9dd3c847fe3db4bf38eed (patch)
treec660d7f628f96c447cc367799887ddaa869b9a3d /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
parent9deb4731a4b6af4c87846b7890e7501f624259d3 (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>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index b1792d27a7..bdfb7dcc06 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