From 0d0a7cbb2fc3aa78475ca3e254e8b7f6d95075c1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 8 Sep 2025 13:05:39 +0100 Subject: [PATCH] Do not process descriptor access with desc buffers if possibly invalid * Descriptor sets are neatly independent so it's possible to process them without needing any other state to be valid, but descriptor buffers can be partially set state and may also have invalidated state so it's not possible to process them unless we know we're on a correct action of the corresponding type. --- renderdoc/driver/vulkan/vk_replay.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 55d8695d0..993dbf4c8 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -2890,6 +2890,9 @@ rdcarray VulkanReplay::GetDescriptorAccess(uint32_t eventId) rdcarray ret; + const ActionDescription *action = m_pDriver->GetAction(eventId); + const bool compute = action && bool(action->flags & ActionFlags::Dispatch); + if(state.graphics.pipeline != ResourceId()) ret.append(m_pDriver->m_CreationInfo.m_Pipeline[state.graphics.pipeline].staticDescriptorAccess); @@ -2940,6 +2943,15 @@ rdcarray VulkanReplay::GetDescriptorAccess(uint32_t eventId) access.descriptorStore = rm->GetOriginalID(descSets[setIdx].descSet); } } + else if(action == NULL || ((!compute && access.stage == ShaderStage::Compute) || + (compute && access.stage != ShaderStage::Compute))) + { + // descriptor buffer state can be temporarily invalid due to multiple stage binding and be + // perturbed across stages if buffers are rebound without offsets or vice-versa, do not + // display descriptor access for descriptor buffers if no action is selected, or the access + // comes from the alternate pipeline + access.descriptorStore = ResourceId(); + } else if(bufSetIdx >= 0 || inlinebufSetIdx >= 0) { const rdcarray &descSets =