mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-31 20:01:12 +00:00
Submit wait semaphores when rendering vulkan overlay. Closes #1110
This commit is contained in:
@@ -234,7 +234,8 @@ VkCommandBuffer WrappedVulkan::GetNextCmd()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WrappedVulkan::SubmitCmds()
|
||||
void WrappedVulkan::SubmitCmds(VkSemaphore *unwrappedWaitSemaphores,
|
||||
VkPipelineStageFlags *waitStageMask, uint32_t waitSemaphoreCount)
|
||||
{
|
||||
// nothing to do
|
||||
if(m_InternalCmds.pendingcmds.empty())
|
||||
@@ -247,9 +248,9 @@ void WrappedVulkan::SubmitCmds()
|
||||
VkSubmitInfo submitInfo = {
|
||||
VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
NULL,
|
||||
0,
|
||||
NULL,
|
||||
NULL, // wait semaphores
|
||||
waitSemaphoreCount,
|
||||
unwrappedWaitSemaphores,
|
||||
waitStageMask,
|
||||
(uint32_t)cmds.size(),
|
||||
&cmds[0], // command buffers
|
||||
0,
|
||||
|
||||
@@ -878,7 +878,8 @@ public:
|
||||
return m_PhysicalDevice;
|
||||
}
|
||||
VkCommandBuffer GetNextCmd();
|
||||
void SubmitCmds();
|
||||
void SubmitCmds(VkSemaphore *unwrappedWaitSemaphores = NULL,
|
||||
VkPipelineStageFlags *waitStageMask = NULL, uint32_t waitSemaphoreCount = 0);
|
||||
VkSemaphore GetNextSemaphore();
|
||||
void SubmitSemaphores();
|
||||
void FlushQ();
|
||||
|
||||
@@ -660,6 +660,7 @@ VkResult WrappedVulkan::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
|
||||
}
|
||||
RDCASSERT(pPresentInfo->pNext == NULL);
|
||||
|
||||
// TODO support multiple swapchains here
|
||||
VkResourceRecord *swaprecord = GetRecord(pPresentInfo->pSwapchains[0]);
|
||||
RDCASSERT(swaprecord->swapInfo);
|
||||
|
||||
@@ -678,6 +679,9 @@ VkResult WrappedVulkan::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
|
||||
|
||||
if(overlay & eRENDERDOC_Overlay_Enabled)
|
||||
{
|
||||
// we'll do the wait ourselves before rendering the overlay
|
||||
unwrappedInfo.waitSemaphoreCount = 0;
|
||||
|
||||
VkRenderPass rp = swapInfo.rp;
|
||||
VkImage im = swapInfo.images[pPresentInfo->pImageIndices[0]].im;
|
||||
VkFramebuffer fb = swapInfo.images[pPresentInfo->pImageIndices[0]].fb;
|
||||
@@ -752,7 +756,9 @@ VkResult WrappedVulkan::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
|
||||
|
||||
ObjDisp(textstate.cmd)->EndCommandBuffer(Unwrap(textstate.cmd));
|
||||
|
||||
SubmitCmds();
|
||||
std::vector<VkPipelineStageFlags> waitStage(unwrappedSems.size(),
|
||||
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
|
||||
SubmitCmds(unwrappedSems.data(), waitStage.data(), (uint32_t)unwrappedSems.size());
|
||||
|
||||
if(swapQueueIndex != m_QueueFamilyIdx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user