mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-24 07:26:34 +00:00
Explicitly choose when to submit OutsideCmdBuffer on vulkan
* This prevents problems where a drawcall callback submits the command buffer before we're finished recording it.
This commit is contained in:
@@ -234,6 +234,23 @@ VkCommandBuffer WrappedVulkan::GetNextCmd()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WrappedVulkan::RemovePendingCommandBuffer(VkCommandBuffer cmd)
|
||||
{
|
||||
for(auto it = m_InternalCmds.pendingcmds.begin(); it != m_InternalCmds.pendingcmds.end(); ++it)
|
||||
{
|
||||
if(*it == cmd)
|
||||
{
|
||||
m_InternalCmds.pendingcmds.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WrappedVulkan::AddPendingCommandBuffer(VkCommandBuffer cmd)
|
||||
{
|
||||
m_InternalCmds.pendingcmds.push_back(cmd);
|
||||
}
|
||||
|
||||
void WrappedVulkan::SubmitCmds(VkSemaphore *unwrappedWaitSemaphores,
|
||||
VkPipelineStageFlags *waitStageMask, uint32_t waitSemaphoreCount)
|
||||
{
|
||||
@@ -2849,6 +2866,9 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay
|
||||
{
|
||||
VkCommandBuffer cmd = m_OutsideCmdBuffer = GetNextCmd();
|
||||
|
||||
// we'll explicitly submit this when we're ready
|
||||
RemovePendingCommandBuffer(cmd);
|
||||
|
||||
VkCommandBufferBeginInfo beginInfo = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
|
||||
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
|
||||
|
||||
@@ -2946,6 +2966,8 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay
|
||||
|
||||
ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
AddPendingCommandBuffer(cmd);
|
||||
|
||||
SubmitCmds();
|
||||
|
||||
m_OutsideCmdBuffer = VK_NULL_HANDLE;
|
||||
|
||||
@@ -928,6 +928,8 @@ public:
|
||||
return m_PhysicalDevice;
|
||||
}
|
||||
VkCommandBuffer GetNextCmd();
|
||||
void RemovePendingCommandBuffer(VkCommandBuffer cmd);
|
||||
void AddPendingCommandBuffer(VkCommandBuffer cmd);
|
||||
void SubmitCmds(VkSemaphore *unwrappedWaitSemaphores = NULL,
|
||||
VkPipelineStageFlags *waitStageMask = NULL, uint32_t waitSemaphoreCount = 0);
|
||||
VkSemaphore GetNextSemaphore();
|
||||
|
||||
Reference in New Issue
Block a user