aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
diff options
context:
space:
mode:
authorBerthold Krevert <berthold.krevert@basyskom.com>2017-05-01 23:03:41 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2017-05-11 06:25:33 +0000
commit59a70377683445f4355b5e3eef50869b61331cfa (patch)
tree3c57be4e966ac34cc5d3a05cc02283a1b82c4f45 /src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
parentd15d9884d024f69c20c0c49a4f915236db845cf7 (diff)
Fix QSG_VISUALIZE=batches
Since I362e1cb8e10 the batch renderer defaults to QSG_SEPARATE_INDEX_BUFFER which broke the batches visualization Change-Id: If1d51cabb0cc4a3a98ac2c01bd78789d08fe72f7 Reviewed-by: Gunnar Sletta <gunnar@crimson.no> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index b8ebeaca63..78f2c86f6c 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2966,7 +2966,11 @@ void Renderer::visualizeBatch(Batch *b)
for (int ds=0; ds<b->drawSets.size(); ++ds) {
const DrawSet &set = b->drawSets.at(ds);
glVertexAttribPointer(a.position, 2, a.type, false, g->sizeOfVertex(), (void *) (qintptr) (set.vertices));
+#ifdef QSG_SEPARATE_INDEX_BUFFER
+ glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->ibo.data + set.indices));
+#else
glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->vbo.data + set.indices));
+#endif
}
} else {
Element *e = b->first;