Skip to content

Commit a606bcd

Browse files
committed
Add EID shift to loose events & uaage after IndirectDraw*Count
Apply to loose events i.e. Barriers and resource usage in the current command buffer info Fixes incorrect event ID in UI and resource usage for non-Action events at the end of a command buffer which contained IndirectDraw*Count calls
1 parent e4a3fdc commit a606bcd

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo)
632632
localAnnotations = m_RootAnnotation->Duplicate();
633633

634634
size_t curAnnot = 0;
635+
int32_t totalEIDShift = 0;
635636

636637
rdcarray<VulkanActionTreeNode> &cmdBufNodes = cmdBufInfo.action->children;
637638

@@ -711,6 +712,7 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo)
711712

712713
// this can be negative if indirectCount is 0
713714
int32_t eidShift = indirectCount - 1;
715+
totalEIDShift += eidShift;
714716

715717
// we reserved one event and action for the indirect count based action.
716718
// if we ended up with a different number eidShift will be non-zero, so we need to adjust
@@ -942,6 +944,15 @@ void WrappedVulkan::InsertActionsAndRefreshIDs(BakedCmdBufferInfo &cmdBufInfo)
942944
GetActionStack().pop_back();
943945
}
944946

947+
if(totalEIDShift != 0)
948+
{
949+
// Move the loose events and resource usage by the total EID shift
950+
for(auto it = cmdBufInfo.curEvents.begin(); it != cmdBufInfo.curEvents.end(); ++it)
951+
it->eventId += totalEIDShift;
952+
for(auto it = cmdBufInfo.resourceUsage.begin(); it != cmdBufInfo.resourceUsage.end(); ++it)
953+
it->second.eventId += totalEIDShift;
954+
}
955+
945956
delete localAnnotations;
946957
}
947958

0 commit comments

Comments
 (0)