queuePresent overload for passing a wait semaphore (#65)

This commit is contained in:
saschawillems 2016-03-06 16:18:29 +01:00
parent 9339cba2ad
commit 52045a1dde

View file

@ -399,6 +399,24 @@ public:
return fpQueuePresentKHR(queue, &presentInfo); return fpQueuePresentKHR(queue, &presentInfo);
} }
// Present the current image to the queue
VkResult queuePresent(VkQueue queue, uint32_t currentBuffer, VkSemaphore waitSemaphore)
{
VkPresentInfoKHR presentInfo = {};
presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
presentInfo.pNext = NULL;
presentInfo.swapchainCount = 1;
presentInfo.pSwapchains = &swapChain;
presentInfo.pImageIndices = &currentBuffer;
if (waitSemaphore != VK_NULL_HANDLE)
{
presentInfo.pWaitSemaphores = &waitSemaphore;
presentInfo.waitSemaphoreCount = 1;
}
return fpQueuePresentKHR(queue, &presentInfo);
}
// Free all Vulkan resources used by the swap chain // Free all Vulkan resources used by the swap chain
void cleanup() void cleanup()
{ {