aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-02-06 13:28:57 +0100
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-02-07 09:41:58 +0000
commit098ba086530ccd555369a9ea88f3c6668726ab81 (patch)
treeacd2175cc085d929440cc71f67d1745a9a4d8682
parentc6b3c69e014f846a142c2429cd2d675c75b74245 (diff)
Fix performance regression
Reverts 2c2e7f27426cb4381f2dcaa36affe55719619753. WebGL does not support a shared index and vertex buffer. Due to a performance regression, this patch is reverted. Task-number: QTBUG-66191 Change-Id: I296d2a6c1c7b5fa66532bd7e106f5360d9d2403a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h9
-rw-r--r--src/quick/scenegraph/scenegraph.pri2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index b0a14d23b9..59fea87add 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -440,7 +440,9 @@ struct Batch
mutable uint uploadedThisFrame : 1; // solely for debugging purposes
Buffer vbo;
+#ifdef QSG_SEPARATE_INDEX_BUFFER
Buffer ibo;
+#endif
QDataBuffer<DrawSet> drawSets;
};
@@ -743,7 +745,9 @@ private:
ClipType m_currentClipType;
QDataBuffer<char> m_vertexUploadPool;
+#ifdef QSG_SEPARATE_INDEX_BUFFER
QDataBuffer<char> m_indexUploadPool;
+#endif
// For minimal OpenGL core profile support
QOpenGLVertexArrayObject *m_vao;
@@ -763,7 +767,10 @@ Batch *Renderer::newBatch()
m_batchPool.resize(size - 1);
} else {
b = new Batch();
- memset(&b->vbo, 0, sizeof(Buffer) * 2); // Clear VBO & IBO
+ memset(&b->vbo, 0, sizeof(Buffer));
+#ifdef QSG_SEPARATE_INDEX_BUFFER
+ memset(&b->ibo, 0, sizeof(Buffer));
+#endif
}
b->init();
return b;
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index 38c3b8dd85..edf4aa08c5 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -1,4 +1,4 @@
-DEFINES += QSG_SEPARATE_INDEX_BUFFER
+# DEFINES += QSG_SEPARATE_INDEX_BUFFER
# DEFINES += QSG_DISTANCEFIELD_CACHE_DEBUG
# Core API