Synchronization semaphore for offscreen pass
This commit is contained in:
parent
60c817691e
commit
2f5a3705ab
1 changed files with 19 additions and 9 deletions
|
|
@ -1074,18 +1074,28 @@ public:
|
||||||
{
|
{
|
||||||
VulkanExampleBase::prepareFrame();
|
VulkanExampleBase::prepareFrame();
|
||||||
|
|
||||||
std::vector<VkCommandBuffer> submitCmdBuffers;
|
// Offscreen rendering
|
||||||
|
|
||||||
// Submit offscreen rendering command buffer
|
|
||||||
// todo : use event to ensure that offscreen result is finished bfore render command buffer is started
|
|
||||||
if (glow)
|
if (glow)
|
||||||
{
|
{
|
||||||
submitCmdBuffers.push_back(offscreenPass.commandBuffer);
|
// Wait for swap chain presentation to finish
|
||||||
}
|
submitInfo.pWaitSemaphores = &semaphores.presentComplete;
|
||||||
submitCmdBuffers.push_back(drawCmdBuffers[currentBuffer]);
|
// Signal ready with offscreen semaphore
|
||||||
|
submitInfo.pSignalSemaphores = &offscreenPass.semaphore;
|
||||||
|
|
||||||
submitInfo.commandBufferCount = submitCmdBuffers.size();
|
// Submit work
|
||||||
submitInfo.pCommandBuffers = submitCmdBuffers.data();
|
submitInfo.commandBufferCount = 1;
|
||||||
|
submitInfo.pCommandBuffers = &offscreenPass.commandBuffer;
|
||||||
|
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scene rendering
|
||||||
|
// Wait for offscreen semaphore
|
||||||
|
submitInfo.pWaitSemaphores = &offscreenPass.semaphore;
|
||||||
|
// Signal ready with render complete semaphpre
|
||||||
|
submitInfo.pSignalSemaphores = &semaphores.renderComplete;
|
||||||
|
|
||||||
|
// Submit work
|
||||||
|
submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
|
||||||
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||||
|
|
||||||
VulkanExampleBase::submitFrame();
|
VulkanExampleBase::submitFrame();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue