Skip to content

Commit 7da9fd2

Browse files
committed
Fixes for loose events on secondary command buffers
- Don't modify the command buffer loose events because the the command buffer might be executed multiple times
1 parent 93fc846 commit 7da9fd2

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

renderdoc/driver/vulkan/wrappers/vk_cmd_funcs.cpp

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5547,6 +5547,15 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman
55475547
parentCmdBufInfo.resourceUsage.back().second.eventId += parentCmdBufInfo.curEventID;
55485548
}
55495549

5550+
// pull in any remaining events on the command buffer that weren't added to an action
5551+
for(const APIEvent &event : cmdBufInfo.curEvents)
5552+
{
5553+
APIEvent apievent(event);
5554+
apievent.eventId += parentCmdBufInfo.curEventID;
5555+
5556+
parentCmdBufInfo.curEvents.push_back(apievent);
5557+
}
5558+
55505559
// Record execution of the secondary command buffer in the parent's CommandBufferNode
55515560
// Only primary command buffers can be submitted
55525561
CommandBufferExecuteInfo execInfo;
@@ -5560,18 +5569,6 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(SerialiserType &ser, VkComman
55605569
parentCmdBufInfo.curEventID += cmdBufInfo.eventCount;
55615570
parentCmdBufInfo.actionCount += cmdBufInfo.actionCount;
55625571

5563-
// pull in any remaining events on the command buffer that weren't added to an action
5564-
uint32_t i = 0;
5565-
for(APIEvent &apievent : cmdBufInfo.curEvents)
5566-
{
5567-
apievent.eventId = parentCmdBufInfo.curEventID - cmdBufInfo.curEvents.count() + i;
5568-
5569-
parentCmdBufInfo.curEvents.push_back(apievent);
5570-
i++;
5571-
}
5572-
5573-
cmdBufInfo.curEvents.clear();
5574-
55755572
marker.customName = StringFormat::Fmt(
55765573
"=> vkCmdExecuteCommands()[%u]: vkEndCommandBuffer(%s)", c, ToStr(cmd).c_str());
55775574
marker.flags =

0 commit comments

Comments
 (0)