diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-12-08 18:58:17 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-01-13 16:08:56 +0000 |
commit | 32ff2d08a03d533ab157f57513937a0e3085c924 (patch) | |
tree | 8983070f9d4616a1bfe15fbe71bae7c38f6383c2 /src/render/graphicshelpers/graphicscontext.cpp | |
parent | d7e9c7a9844b658d93c3f1ac47e96f069162de3d (diff) |
RenderView: sliglty modified to later accommodate compute calls
Change-Id: Ic821747677c9d2f117494d2ecfd89f47f982fa3f
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/graphicshelpers/graphicscontext.cpp')
-rw-r--r-- | src/render/graphicshelpers/graphicscontext.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp index 8fa9bba61..19415d0b8 100644 --- a/src/render/graphicshelpers/graphicscontext.cpp +++ b/src/render/graphicshelpers/graphicscontext.cpp @@ -359,7 +359,6 @@ void GraphicsContext::activateShader(Shader *shader) } if (m_activeShader != Q_NULLPTR && m_activeShader->dna() == shader->dna()) { - // no op } else { m_activeShader = shader; @@ -894,8 +893,8 @@ void GraphicsContext::setUniforms(QUniformPack &uniforms) for (int i = 0; i < blockToUbos.length(); ++i) { const ShaderUniformBlock &block = m_activeShader->uniformBlock(blockToUbos[i].m_blockIndex); if (block.m_index != -1 && block.m_size > 0) { - ubo = manager->lookupResource<GLBuffer, GLBufferManager>(ShaderDataShaderUboKey(blockToUbos[i].m_shaderDataID, - m_activeShader->peerUuid())); + ubo = manager->lookupResource<GLBuffer, GLBufferManager>(BufferShaderKey(blockToUbos[i].m_shaderDataID, + m_activeShader->peerUuid())); // bind Uniform Block of index ubos[i].m_index to binding point i bindUniformBlock(m_activeShader->getOrCreateProgram(this)->programId(), block.m_index, i); // bind the UBO to the binding point i @@ -909,6 +908,11 @@ void GraphicsContext::setUniforms(QUniformPack &uniforms) } // update the ubo if needed + + // TO DO: Maybe QShaderData should act as a QBuffer data provider + // and internally update a QBuffer which we would then reupload + // and the ShaderData updates could then be done in some jobs + // rather than at render time ? if (blockToUbos[i].m_needsUpdate) { if (!ubo->isBound()) ubo->bind(this, GLBuffer::UniformBuffer); |