From cd8fccc19b57a5f46fb0a953d32d8916e36d1024 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 3 Sep 2019 10:43:25 +0100 Subject: [PATCH] Fix crash with fetching mesh output if no descriptor sets are bound --- renderdoc/driver/vulkan/vk_postvs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renderdoc/driver/vulkan/vk_postvs.cpp b/renderdoc/driver/vulkan/vk_postvs.cpp index b3829f557..d956ac3d3 100644 --- a/renderdoc/driver/vulkan/vk_postvs.cpp +++ b/renderdoc/driver/vulkan/vk_postvs.cpp @@ -1228,6 +1228,8 @@ void VulkanReplay::PatchReservedDescriptors(const VulkanStatePipeline &pipe, // was doing and the other sets are statically unused. setLayouts.resize(RDCMIN(pipe.descSets.size(), pipeDescSetLayouts.size())); + size_t boundDescs = setLayouts.size(); + // need at least one set, if the shader isn't using any we'll just make our own if(setLayouts.empty()) setLayouts.resize(1); @@ -1346,7 +1348,7 @@ void VulkanReplay::PatchReservedDescriptors(const VulkanStatePipeline &pipe, m_pDriver->vkAllocateDescriptorSets(dev, &descSetAllocInfo, descSets.data()); // copy the data across from the real descriptors into our adjusted bindings - for(size_t i = 0; i < setLayouts.size(); i++) + for(size_t i = 0; i < boundDescs; i++) { if(pipe.descSets[i].descSet == ResourceId()) continue;