diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2018-02-05 17:20:08 +0100 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2018-04-24 16:37:10 +0000 |
commit | 5cc8db797a88a0b2654876e768ba9cdebc053534 (patch) | |
tree | 7182acc0607d6611c4143b67fe62afdad6b98e84 /src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | |
parent | 03739f2150d59248fb2c4b688c6352182f630f3e (diff) |
Use different buffer for indices and vertices only in the WebGL plugin
This patch partially reverts 098ba086530ccd555369a9ea88f3c6668726ab81.
Only QtWebGL will use separate buffers for indices and vertices. This
patch gives a performance boost.
Task-number: QTBUG-66191
Task-number: QTBUG-67147
Change-Id: I58b4db2bdf44cd954390e85e079de82031caf9e5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h index 918f3ce82c..12b48c1451 100644 --- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h +++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h @@ -433,9 +433,7 @@ struct Batch mutable uint uploadedThisFrame : 1; // solely for debugging purposes Buffer vbo; -#ifdef QSG_SEPARATE_INDEX_BUFFER Buffer ibo; -#endif QDataBuffer<DrawSet> drawSets; }; @@ -738,9 +736,7 @@ 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; @@ -760,10 +756,8 @@ Batch *Renderer::newBatch() m_batchPool.resize(size - 1); } else { b = new Batch(); - memset(&b->vbo, 0, sizeof(Buffer)); -#ifdef QSG_SEPARATE_INDEX_BUFFER - memset(&b->ibo, 0, sizeof(Buffer)); -#endif + Q_ASSERT(offsetof(Batch, ibo) == sizeof(Buffer) + offsetof(Batch, vbo)); + memset(&b->vbo, 0, sizeof(Buffer) * 2); // Clear VBO & IBO } b->init(); return b; |