Fix event counting for single vulkan indirect multidraws. Closes #2025

* We need to count the fake indirect subcommand *before* checking if we're in
  range, otherwise replaying up to but not including the draw will miscount and
  replay the draw itself.
This commit is contained in:
baldurk
2020-08-27 11:26:03 +01:00
parent 3f63d1532d
commit 4eeaaad75f
@@ -408,6 +408,10 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu
{
// for single draws, it's pretty simple
// account for the fake indirect subcommand before checking if we're in re-record range
if(count > 0)
m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
if(InRerecordRange(m_LastCmdBufferID) && IsDrawInRenderPass())
{
commandBuffer = RerecordCmdBuf(m_LastCmdBufferID);
@@ -424,10 +428,6 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndirect(SerialiserType &ser, VkCommandBu
m_DrawcallCallback->PostRedraw(eventId, commandBuffer);
}
}
// account for the fake indirect subcommand
if(count > 0)
m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
}
else
{
@@ -785,6 +785,10 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser,
{
// for single draws, it's pretty simple
// account for the fake indirect subcommand before checking if we're in re-record range
if(count > 0)
m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
if(InRerecordRange(m_LastCmdBufferID) && IsDrawInRenderPass())
{
commandBuffer = RerecordCmdBuf(m_LastCmdBufferID);
@@ -802,10 +806,6 @@ bool WrappedVulkan::Serialise_vkCmdDrawIndexedIndirect(SerialiserType &ser,
m_DrawcallCallback->PostRedraw(eventId, commandBuffer);
}
}
// account for the fake indirect subcommand
if(count > 0)
m_BakedCmdBufferInfo[m_LastCmdBufferID].curEventID++;
}
else
{