From 2ec946fabff90e1b824a61c8e499e30bf8851dfd Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 17 Jul 2026 12:17:03 +0100 Subject: [PATCH] Change vkCmdExecuteCommands action callback to use full event range Use full event range in the command buffer instead of the actions range --- renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp index 0f3348e17..849bda90b 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp @@ -5720,16 +5720,20 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman auto it = std::lower_bound(m_ActionUses.begin(), m_ActionUses.end(), use); if(it != m_ActionUses.end()) { - uint32_t eventId = it->eventId + 2; + // Skip over the vkCmdExecuteCommands + uint32_t eventId = it->eventId + 1; for(uint32_t i = 0; i < (uint32_t)rerecordedCmds.size(); i++) { ResourceId cmd = GetResID(pCommandBuffers[i]); BakedCmdBufferInfo &info = m_BakedCmdBufferInfo[cmd]; - if(info.action && info.action->children.size() > 0) + uint32_t eventCount = info.eventCount; + // Skip over the virtual marker vkBeginCommandBuffer + uint32_t firstEventId = eventId + 1; + // firstEventId -> lastEventId is an inclusive range + uint32_t lastEventId = firstEventId + eventCount - 1; + if(eventCount > 0) { - uint32_t firstEventId = eventId + info.action->children.front().action.eventId; - uint32_t lastEventId = eventId + info.action->children.back().action.eventId; m_ActionCallback->PreCmdExecute(eventId, firstEventId, lastEventId, commandBuffer); ObjDisp(commandBuffer) @@ -5743,7 +5747,8 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman ->CmdExecuteCommands(Unwrap(commandBuffer), 1, &rerecordedCmds[i]); } - eventId += 2 + m_BakedCmdBufferInfo[cmd].eventCount; + // Skip over the final event and virtual marker vkEndCommandBuffer + eventId = lastEventId + 2; } } }