aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/coreapi
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-11-26 15:58:12 +0100
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-12-09 14:36:38 +0100
commit7955c63bd171d3f5dabdbe1e794d15701701d993 (patch)
tree4dfab06a154ec291ac6ed56791c014851ff477a9 /src/quick/scenegraph/coreapi
parent26c3b0654a768b181142cea5aab2641956975e4c (diff)
Fix the visualization of unmerged batch geometries without index
indexData() is null for most QSGGeometryNodes subclasses in QtQuick, make sure that we draw using vertex array data in that case. The patch also increases the contrast of the line pattern, since it is almost invisible with brighter hue values, to make it easier to see which batches aren't merged. Change-Id: Ife7b26692ee318feb0810ee0e787289eb151ea8a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/scenegraph/coreapi')
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 2f94bad75d..dbea0faa9a 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2766,7 +2766,10 @@ void Renderer::visualizeBatch(Batch *b)
g = gn->geometry();
shader->setUniformValue(shader->matrix, matrix * *gn->matrix());
glVertexAttribPointer(a.position, a.tupleSize, a.type, false, g->sizeOfVertex(), (void *) (qintptr) offset);
- glDrawElements(g->drawingMode(), g->indexCount(), g->indexType(), g->indexData());
+ if (g->indexCount())
+ glDrawElements(g->drawingMode(), g->indexCount(), g->indexType(), g->indexData());
+ else
+ glDrawArrays(g->drawingMode(), 0, g->vertexCount());
offset += g->sizeOfVertex() * g->vertexCount();
e = e->nextInBatch;
}