Fix duplicate vkQueueSubmit2 events when commandBufferInfoCount == 0

Add a "No Command Buffers" virtual label action, preventing `WrappedVulkan::ContextProcessChunk` from adding a duplicate event.
This commit is contained in:
James0124
2022-08-08 22:49:20 +09:00
committed by Baldur Karlsson
parent c64406b18f
commit 2354d656db
@@ -259,6 +259,22 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2 submitInfo, r
// we're adding multiple events, need to increment ourselves
m_RootEventID++;
if(submitInfo.commandBufferInfoCount == 0)
{
rdcstr name = StringFormat::Fmt("=> %s: No Command Buffers", basename.c_str());
ActionDescription action;
action.customName = name;
action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary;
AddEvent();
m_RootEvents.back().chunkIndex = APIEvent::NoChunk;
m_Events.back().chunkIndex = APIEvent::NoChunk;
AddAction(action);
m_RootEventID++;
}
for(uint32_t c = 0; c < submitInfo.commandBufferInfoCount; c++)
{
ResourceId cmd = GetResourceManager()->GetOriginalID(
@@ -363,6 +379,13 @@ void WrappedVulkan::ReplayQueueSubmit(VkQueue queue, VkSubmitInfo2 submitInfo, r
// account for the queue submit event
m_RootEventID++;
if(submitInfo.commandBufferInfoCount == 0)
{
// account for the "No Command Buffers" virtual label
m_RootEventID++;
m_RootActionID++;
}
uint32_t startEID = m_RootEventID;
// advance m_CurEventID to match the events added when reading