Let drawcall callbacks specify that all cmd buffers should be re-done

This commit is contained in:
baldurk
2016-02-07 18:49:49 +01:00
parent 4814c58ab8
commit 8134642812
5 changed files with 34 additions and 4 deletions
+14 -4
View File
@@ -1857,14 +1857,24 @@ VkBool32 WrappedVulkan::DebugCallback(
bool WrappedVulkan::ShouldRerecordCmd(ResourceId cmdid)
{
return m_PartialReplayData.outsideCmdBuffer != VK_NULL_HANDLE ||
cmdid == m_PartialReplayData.partialParent;
if(m_PartialReplayData.outsideCmdBuffer != VK_NULL_HANDLE)
return true;
if(m_DrawcallCallback && m_DrawcallCallback->RecordAllCmds())
return true;
return cmdid == m_PartialReplayData.partialParent;
}
bool WrappedVulkan::InRerecordRange()
{
return m_PartialReplayData.outsideCmdBuffer != VK_NULL_HANDLE ||
m_BakedCmdBufferInfo[m_PartialReplayData.partialParent].curEventID <= m_LastEventID - m_PartialReplayData.baseEvent;
if(m_PartialReplayData.outsideCmdBuffer != VK_NULL_HANDLE)
return true;
if(m_DrawcallCallback && m_DrawcallCallback->RecordAllCmds())
return true;
return m_BakedCmdBufferInfo[m_PartialReplayData.partialParent].curEventID <= m_LastEventID - m_PartialReplayData.baseEvent;
}
VkCommandBuffer WrappedVulkan::RerecordCmdBuf()
+5
View File
@@ -116,6 +116,11 @@ struct DrawcallCallback
virtual void PreDraw(uint32_t eid, VkCommandBuffer cmd) = 0;
virtual bool PostDraw(uint32_t eid, VkCommandBuffer cmd) = 0;
virtual void PostRedraw(uint32_t eid, VkCommandBuffer cmd) = 0;
// should we re-record all command buffers? this needs to be true if the range
// being replayed is larger than one command buffer (which usually means the
// whole frame).
virtual bool RecordAllCmds() = 0;
};
class WrappedVulkan : public IFrameCapturer
+5
View File
@@ -98,6 +98,11 @@ struct GPUTimerCallback : public DrawcallCallback
{
}
bool RecordAllCmds()
{
return true;
}
WrappedVulkan *m_pDriver;
VulkanReplay *m_pReplay;
VkQueryPool m_QueryPool;
+5
View File
@@ -2314,6 +2314,11 @@ struct QuadOverdrawCallback : public DrawcallCallback
// nothing to do
}
bool RecordAllCmds()
{
return false;
}
uint32_t m_FrameID;
WrappedVulkan *m_pDriver;
VulkanDebugManager *m_pDebug;
+5
View File
@@ -3806,6 +3806,11 @@ struct InitPostVSCallback : public DrawcallCallback
{
}
bool RecordAllCmds()
{
return false;
}
uint32_t m_FrameID;
WrappedVulkan *m_pDriver;
VulkanReplay *m_pReplay;