diff --git a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp index 167e6c90d..8d55053c6 100644 --- a/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp +++ b/renderdoc/driver/d3d12/d3d12_command_queue_wrap.cpp @@ -594,16 +594,16 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(SerialiserType &se m_Cmd.m_Events[apievent.eventId] = apievent; } - m_Cmd.m_RootEventID += cmdListInfo.eventCount; - m_Cmd.m_RootActionID += cmdListInfo.actionCount; - for(auto it = cmdListInfo.resourceUsage.begin(); it != cmdListInfo.resourceUsage.end(); ++it) { EventUsage u = it->second; - u.eventId += m_Cmd.m_RootEventID - cmdListInfo.curEvents.count(); + u.eventId += m_Cmd.m_RootEventID; m_Cmd.m_ResourceUses[it->first].push_back(u); } + m_Cmd.m_RootEventID += cmdListInfo.eventCount; + m_Cmd.m_RootActionID += cmdListInfo.actionCount; + { action.customName = StringFormat::Fmt("=> %s[%u]: Close(%s)", basename.c_str(), c, ToStr(cmd).c_str()); diff --git a/renderdoc/driver/d3d12/d3d12_commands.cpp b/renderdoc/driver/d3d12/d3d12_commands.cpp index d753d34aa..1fe50cdf0 100644 --- a/renderdoc/driver/d3d12/d3d12_commands.cpp +++ b/renderdoc/driver/d3d12/d3d12_commands.cpp @@ -1618,16 +1618,14 @@ void BakedCmdListInfo::ShiftForRemoved(uint32_t shiftActionID, uint32_t shiftEID for(APIEvent &ev : actions[i].action.events) ev.eventId -= shiftEID; + + for(size_t u = 0; u < actions[i].resourceUsage.size(); u++) + actions[i].resourceUsage[u].second.eventId -= shiftEID; } uint32_t lastEID = actions[idx].action.eventId; // shift any resource usage for actions after the removed section - for(size_t i = 0; i < action->resourceUsage.size(); i++) - { - if(action->resourceUsage[i].second.eventId >= lastEID) - action->resourceUsage[i].second.eventId -= shiftEID; - } // patch any subsequent executes for(size_t i = 0; i < executeEvents.size(); i++)