From 9486a8a4b60a678280db2c625064ca78b3aaf489 Mon Sep 17 00:00:00 2001 From: Paul Lemire Date: Fri, 21 Sep 2018 07:53:11 +0200 Subject: 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 --- .../renderers/opengl/graphicshelpers/submissioncontext.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp') 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 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 } -- cgit v1.2.3