Skip to content
Permalink
Browse files

- fix command buffer invalidation bug when DynamicSet is updated

  • Loading branch information...
dpjudas authored and madame-rachelle committed May 9, 2019
1 parent 42d0209 commit d9722297a4a15836aaf5deeceaa84fc2787a3069
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/rendering/vulkan/renderer/vk_renderpass.cpp
@@ -165,6 +165,11 @@ void VkRenderPassManager::UpdateDynamicSet()
{
auto fb = GetVulkanFrameBuffer();

// In some rare cases drawing commands may already have been created before VulkanFrameBuffer::BeginFrame is called.
// Make sure there there are no active command buffers using DynamicSet when we update it:
fb->GetRenderState()->EndRenderPass();
fb->WaitForCommands(false);

WriteDescriptors update;
update.addBuffer(DynamicSet.get(), 0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, fb->ViewpointUBO->mBuffer.get(), 0, sizeof(HWViewpointUniforms));
update.addBuffer(DynamicSet.get(), 1, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, fb->LightBufferSSO->mBuffer.get());

0 comments on commit d972229

Please sign in to comment.
You can’t perform that action at this time.