From e3644c317449570f8016baccc0a8a791dcb2dd91 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 6 Jul 2017 16:04:23 +0100 Subject: [PATCH] Bind all compatible descriptor sets, don't bail at the first one * When descriptor sets are invalidated and we have stale bindings around we cannot bind them or it will lead to invalid behaviour and crashes. * However it's possible for set 0 to be invalid/stale and set 1 to be valid and required, so we can't bail out at the first invalid set. We keep iterating and bind all valid compatible sets. --- renderdoc/driver/vulkan/vk_state.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_state.cpp b/renderdoc/driver/vulkan/vk_state.cpp index 269e4c90b..f4a186e41 100644 --- a/renderdoc/driver/vulkan/vk_state.cpp +++ b/renderdoc/driver/vulkan/vk_state.cpp @@ -213,7 +213,11 @@ void VulkanRenderState::BindPipeline(VkCommandBuffer cmd, PipelineBinding bindin m_CreationInfo->m_DescSetLayout[createdDescSetLayoutId]; if(descLayout != createdDescLayout) - break; + { + // this set is incompatible, don't rebind it. Assume the application knows the shader + // doesn't need this set, and the binding is just stale + continue; + } } // if there are dynamic buffers, pass along the offsets