From 1a0df46f6230ca390d493abea01960f13fe18e49 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 2 Dec 2020 16:53:11 +0000 Subject: [PATCH] Fix issue selecting indirect draw sub-command in draw with count=1 --- renderdoc/driver/vulkan/vk_core.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_core.cpp b/renderdoc/driver/vulkan/vk_core.cpp index 859b9254b..bc26283b9 100644 --- a/renderdoc/driver/vulkan/vk_core.cpp +++ b/renderdoc/driver/vulkan/vk_core.cpp @@ -3448,6 +3448,19 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay } } + // if we have an indirect draw with one draw, the subcommand will have an event which isn't + // a DrawcallDescription and selecting it will still replay that indirect draw. We need to + // detect this case and ensure we prepare the RP. + // This doesn't happen for multi-draw indirects because there each subcommand has an actual + // DrawcallDescription + if(rpUnneeded) + { + APIEvent ev = GetEvent(endEventID); + if(m_StructuredFile->chunks[ev.chunkIndex]->metadata.chunkID == + (uint32_t)VulkanChunk::vkCmdIndirectSubCommand) + rpUnneeded = false; + } + // if a render pass was active, begin it and set up the partial replay state m_RenderState.BeginRenderPassAndApplyState( this, cmd, rpUnneeded ? VulkanRenderState::BindNone : VulkanRenderState::BindGraphics);