Skip to content

Commit a0caa33

Browse files
committed
Improve Vulkan handling of zero count Submits
1 parent 14d36bd commit a0caa33

1 file changed

Lines changed: 38 additions & 22 deletions

File tree

renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,22 +1494,30 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(SerialiserType &ser, VkQueue queue,
14941494
}
14951495
if(submitCount == 0)
14961496
{
1497-
AddEvent();
1497+
if(IsLoading(m_State))
1498+
{
1499+
AddEvent();
14981500

1499-
// we're adding multiple events, need to increment ourselves
1500-
m_RootEventID++;
1501+
// we're adding multiple events, need to increment ourselves
1502+
m_RootEventID++;
15011503

1502-
ObjDisp(queue)->QueueSubmit(Unwrap(queue), 0, NULL, VK_NULL_HANDLE);
1504+
ObjDisp(queue)->QueueSubmit(Unwrap(queue), 0, NULL, VK_NULL_HANDLE);
15031505

1504-
ActionDescription action;
1505-
action.customName = "=> vkQueueSubmit(): No Submit";
1506-
action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary;
1507-
AddEvent();
1506+
ActionDescription action;
1507+
action.customName = "=> vkQueueSubmit(): No Submit";
1508+
action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary;
1509+
AddEvent();
15081510

1509-
m_RootEvents.back().chunkIndex = APIEvent::NoChunk;
1510-
m_Events.back().chunkIndex = APIEvent::NoChunk;
1511+
m_RootEvents.back().chunkIndex = APIEvent::NoChunk;
1512+
m_Events.back().chunkIndex = APIEvent::NoChunk;
15111513

1512-
AddAction(action);
1514+
AddAction(action);
1515+
}
1516+
else
1517+
{
1518+
// account for the queue submit event
1519+
m_RootEventID++;
1520+
}
15131521
}
15141522
else
15151523
{
@@ -1687,22 +1695,30 @@ bool WrappedVulkan::Serialise_vkQueueSubmit2(SerialiserType &ser, VkQueue queue,
16871695
}
16881696
if(submitCount == 0)
16891697
{
1690-
AddEvent();
1698+
if(IsLoading(m_State))
1699+
{
1700+
AddEvent();
16911701

1692-
// we're adding multiple events, need to increment ourselves
1693-
m_RootEventID++;
1702+
// we're adding multiple events, need to increment ourselves
1703+
m_RootEventID++;
16941704

1695-
ObjDisp(queue)->QueueSubmit2(Unwrap(queue), 0, NULL, VK_NULL_HANDLE);
1705+
ObjDisp(queue)->QueueSubmit2(Unwrap(queue), 0, NULL, VK_NULL_HANDLE);
16961706

1697-
ActionDescription action;
1698-
action.customName = "=> vkQueueSubmit2(): No Submit";
1699-
action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary;
1700-
AddEvent();
1707+
ActionDescription action;
1708+
action.customName = "=> vkQueueSubmit2(): No Submit";
1709+
action.flags |= ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary;
1710+
AddEvent();
17011711

1702-
m_RootEvents.back().chunkIndex = APIEvent::NoChunk;
1703-
m_Events.back().chunkIndex = APIEvent::NoChunk;
1712+
m_RootEvents.back().chunkIndex = APIEvent::NoChunk;
1713+
m_Events.back().chunkIndex = APIEvent::NoChunk;
17041714

1705-
AddAction(action);
1715+
AddAction(action);
1716+
}
1717+
else
1718+
{
1719+
// account for the queue submit event
1720+
m_RootEventID++;
1721+
}
17061722
}
17071723
else
17081724
{

0 commit comments

Comments
 (0)