Commit 0e1798d6 by Tim Van Patten Committed by Commit Bot

Vulkan: PPO: Allocate uniform descriptor set if list is empty

When a Program is used to draw, the buffers to hold uniforms are allocated as part of updateUniforms(), and then if a buffer is allocated, a corresponding descriptor set is allocated for each shader stage with uniforms. However, if that Program is later bound to a PPO, the PPO's descriptor set list is cleared as part of creating the pipeline layout. This means the uniform descriptor sets need to be re-allocated but using the previously allocated buffers so the 'anyNewBufferAllocated' flag isn't enough - we also need to check if the PPO's list of descriptor sets is empty. Bug: angleproject:3570 Test: KHR-GLES31.core.sepshaderobjs.StateInteraction Change-Id: Id8df587b4f5552012590a29d120b6899bbdf677b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2156936Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarCharlie Lao <cclao@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
parent dadd1986
...@@ -140,7 +140,10 @@ angle::Result ProgramPipelineVk::updateUniforms(ContextVk *contextVk) ...@@ -140,7 +140,10 @@ angle::Result ProgramPipelineVk::updateUniforms(ContextVk *contextVk)
++offsetIndex; ++offsetIndex;
} }
if (anyNewBufferAllocated) // The PPO's list of descriptor sets being empty without a new buffer being allocated indicates
// a Program that was already used in a draw command (and thus already allocated uniform
// buffers) has been bound to this PPO.
if (anyNewBufferAllocated || mExecutable.mDescriptorSets.empty())
{ {
// We need to reinitialize the descriptor sets if we newly allocated buffers since we can't // We need to reinitialize the descriptor sets if we newly allocated buffers since we can't
// modify the descriptor sets once initialized. // modify the descriptor sets once initialized.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment