diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-12-10 13:06:33 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-01-13 16:10:36 +0000 |
commit | 412a1d9b1d0b73fcc99c73bd89457cc11ece00fa (patch) | |
tree | 0472dcf48168c4903fa6faf148ae08bc1bd3fd13 /src/render/io | |
parent | 9add600584ab87c80d439c0d5571994d72af3477 (diff) |
RenderView/GraphicsContext: support SSBO/UBO with buffer used as Parameters
Change-Id: I347aa5deea6521b43b9033e2200ab2f8b272f671
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/io')
-rw-r--r-- | src/render/io/glbuffer.cpp | 7 | ||||
-rw-r--r-- | src/render/io/glbuffer_p.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/render/io/glbuffer.cpp b/src/render/io/glbuffer.cpp index 8e7636964..d059949db 100644 --- a/src/render/io/glbuffer.cpp +++ b/src/render/io/glbuffer.cpp @@ -133,7 +133,12 @@ void GLBuffer::update(GraphicsContext *ctx, const void *data, uint size, int off ctx->openGLContext()->functions()->glBufferSubData(m_lastTarget, offset, size, data); } -void GLBuffer::bindToUniformBlock(GraphicsContext *ctx, int bindingPoint) +void GLBuffer::bindBufferBase(GraphicsContext *ctx, int bindingPoint, GLBuffer::Type t) +{ + ctx->bindBufferBase(glBufferTypes[t], bindingPoint, m_bufferId); +} + +void GLBuffer::bindBufferBase(GraphicsContext *ctx, int bindingPoint) { ctx->bindBufferBase(m_lastTarget, bindingPoint, m_bufferId); } diff --git a/src/render/io/glbuffer_p.h b/src/render/io/glbuffer_p.h index 1dc8adb3c..4eeae9624 100644 --- a/src/render/io/glbuffer_p.h +++ b/src/render/io/glbuffer_p.h @@ -81,7 +81,8 @@ public: void allocate(GraphicsContext *ctx, uint size, bool dynamic = true); void allocate(GraphicsContext *ctx, const void *data, uint size, bool dynamic = true); void update(GraphicsContext *ctx, const void *data, uint size, int offset = 0); - void bindToUniformBlock(GraphicsContext *ctx, int bindingPoint); + void bindBufferBase(GraphicsContext *ctx, int bindingPoint, Type t); + void bindBufferBase(GraphicsContext *ctx, int bindingPoint); inline GLuint bufferId() const { return m_bufferId; } inline bool isCreated() const { return m_isCreated; } |