Skip to content

Commit

Permalink
Use independent buffer for indices
Browse files Browse the repository at this point in the history
WebGL does not support using the same buffer for vertices and indices.

Change-Id: I362e1cb8e10dc2b4b99f6ce7161c4e3ce8a6f707
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
  • Loading branch information
jsfdez committed Jan 27, 2017
1 parent 8580736 commit 2c2e7f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
Expand Up @@ -440,9 +440,7 @@ struct Batch
mutable uint uploadedThisFrame : 1; // solely for debugging purposes

Buffer vbo;
#ifdef QSG_SEPARATE_INDEX_BUFFER
Buffer ibo;
#endif

QDataBuffer<DrawSet> drawSets;
};
Expand Down Expand Up @@ -744,9 +742,7 @@ class Q_QUICK_PRIVATE_EXPORT Renderer : public QSGRenderer, public QOpenGLFuncti
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;

Expand All @@ -766,10 +762,7 @@ 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
memset(&b->vbo, 0, sizeof(Buffer) * 2); // Clear VBO & IBO
}
b->init();
return b;
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 2c2e7f2

Please sign in to comment.