diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2017-10-06 15:07:30 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-10-06 13:18:22 +0000 |
commit | f8e25b8a4e299ce519ae622562af650553b325ab (patch) | |
tree | 5be84279e19fac503e7f16d4714b6fb5d2cde14a | |
parent | 835db3b72e0f14ef80afb22dd084bfc038383481 (diff) |
Fix race in renderer
All buffers are uploaded to GPU before the frame submission takes place.
If during frame submission we check for a CPU buffer whether it's dirty, we end up
(rightfully) with a race condition as we are preparing for frame n+1 already.
There must have been a left over when the above changes were made as the
UBO/SSBO code paths would, during rendering, check whether a CPU buffer was
dirty, and if so try to upload, causing a race.
Removed these code paths which aren't needed.
Change-Id: I713a92b881335ecfb30f24bd7485a7bac29be4b7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/render/graphicshelpers/graphicscontext.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp index b13449760..7b09985a7 100644 --- a/src/render/graphicshelpers/graphicscontext.cpp +++ b/src/render/graphicshelpers/graphicscontext.cpp @@ -1204,11 +1204,6 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) // be bound as a VertexArray bindGLBuffer(ssbo, GLBuffer::ShaderStorageBuffer); ssbo->bindBufferBase(this, ssboIndex++, GLBuffer::ShaderStorageBuffer); - // Perform update if required - if (cpuBuffer->isDirty()) { - uploadDataToGLBuffer(cpuBuffer, ssbo); - cpuBuffer->unsetDirty(); - } // TO DO: Make sure that there's enough binding points } @@ -1224,11 +1219,6 @@ void GraphicsContext::setParameters(ShaderParameterPack ¶meterPack) // be bound as a VertexArray bindGLBuffer(ubo, GLBuffer::UniformBuffer); ubo->bindBufferBase(this, uboIndex++, GLBuffer::UniformBuffer); - if (cpuBuffer->isDirty()) { - // Perform update if required - uploadDataToGLBuffer(cpuBuffer, ubo); - cpuBuffer->unsetDirty(); - } // TO DO: Make sure that there's enough binding points } |