diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2018-09-21 07:53:11 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2018-09-21 07:54:37 +0000 |
commit | 9486a8a4b60a678280db2c625064ca78b3aaf489 (patch) | |
tree | 45ac30029bbe12a3d98d373bdb8cf48c174ab422 /src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | |
parent | 9884d3bffcdee9c6aabc51b036554947873b11c4 (diff) |
Complete ES 3.1 and 3.2 helpers
Which didn't handle indirect drawing, compute and tessellation
Since ES 3.1/3.2 don't provide API for glShaderStorageBlockBinding,
code was adjusted to use the default binding points and not require
that API.
Change-Id: Ie4dcd05f0a1d72e4a25f49b5fae138dc605ba5e3
Task-number: QTBUG-70660
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp')
-rw-r--r-- | src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp index 7bb0713ee..26ee94305 100644 --- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -1291,15 +1291,19 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack) // Bind Shader Storage block to SSBO and update SSBO const QVector<BlockToSSBO> blockToSSBOs = parameterPack.shaderStorageBuffers(); - int ssboIndex = 0; for (const BlockToSSBO b : blockToSSBOs) { Buffer *cpuBuffer = m_renderer->nodeManagers()->bufferManager()->lookupResource(b.m_bufferID); GLBuffer *ssbo = glBufferForRenderBuffer(cpuBuffer, GLBuffer::ShaderStorageBuffer); - bindShaderStorageBlock(shader->programId(), b.m_blockIndex, ssboIndex); + + // bindShaderStorageBlock + // This is currently not required as we are introspecting the bindingIndex + // value from the shaders and not replacing them, making such a call useless + // bindShaderStorageBlock(shader->programId(), b.m_blockIndex, b.m_bindingIndex); + // Needed to avoid conflict where the buffer would already // be bound as a VertexArray bindGLBuffer(ssbo, GLBuffer::ShaderStorageBuffer); - ssbo->bindBufferBase(this, ssboIndex++, GLBuffer::ShaderStorageBuffer); + ssbo->bindBufferBase(this, b.m_bindingIndex, GLBuffer::ShaderStorageBuffer); // TO DO: Make sure that there's enough binding points } |