diff options
author | Kevin Ottens <kevin.ottens@kdab.com> | 2017-09-13 10:23:33 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-09-22 09:42:42 +0000 |
commit | a0d54cd571cf7546ac05383213555b618656b50d (patch) | |
tree | 2e86f135605de8b823d88728f7122e0b056623a8 /src/render/graphicshelpers | |
parent | 3d0abc640eb0ce2f232d2994c124f6544e3efda1 (diff) |
Hardcode a binding point for buffer uploads
For uploading the data in a buffer, the binding point doesn't really
matter so always use the same binding point.
This is the first step toward finally deprecating QBuffer::type, this is
going to be a long journey it seems.
Change-Id: Icad36d35764cbc25d249a651b80ebbce6b34828d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers')
-rw-r--r-- | src/render/graphicshelpers/graphicscontext.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp index 11132c5ed..04081280f 100644 --- a/src/render/graphicshelpers/graphicscontext.cpp +++ b/src/render/graphicshelpers/graphicscontext.cpp @@ -1621,7 +1621,7 @@ bool GraphicsContext::bindGLBuffer(GLBuffer *buffer, GLBuffer::Type type) void GraphicsContext::uploadDataToGLBuffer(Buffer *buffer, GLBuffer *b, bool releaseBuffer) { - if (!bindGLBuffer(b, bufferTypeToGLBufferType(buffer->type()))) + if (!bindGLBuffer(b, GLBuffer::ArrayBuffer)) // We're uploading, the type doesn't matter here qCWarning(Render::Io) << Q_FUNC_INFO << "buffer bind failed"; // If the buffer is dirty (hence being called here) // there are two possible cases @@ -1663,8 +1663,7 @@ void GraphicsContext::uploadDataToGLBuffer(Buffer *buffer, GLBuffer *b, bool rel if (releaseBuffer) { b->release(this); - if (bufferTypeToGLBufferType(buffer->type()) == GLBuffer::ArrayBuffer) - m_boundArrayBuffer = nullptr; + m_boundArrayBuffer = nullptr; } qCDebug(Render::Io) << "uploaded buffer size=" << buffer->data().size(); } |