From f1d7980c4e31295c055120315224376c11b0466e Mon Sep 17 00:00:00 2001 From: "re.kovalev" Date: Mon, 14 Mar 2022 18:31:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BA=D0=B0?= =?UTF-8?q?=D0=B4=D1=80=D0=B0=20=D0=BD=D0=B0=20=D1=8D=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/vk.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/vk.cpp b/src/vk.cpp index 98a131e..a47d13a 100644 --- a/src/vk.cpp +++ b/src/vk.cpp @@ -1065,4 +1065,17 @@ void Vulkan::renderFrame() } currentFrame = (currentFrame + 1) % surface.imageCount; + + VkPresentInfoKHR presentInfo{}; + presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; + presentInfo.waitSemaphoreCount = 1; + presentInfo.pWaitSemaphores = signalSemaphores; + presentInfo.swapchainCount = 1; + presentInfo.pSwapchains = &swapChain; + presentInfo.pImageIndices = &imageIndex; + + if (vkQueuePresentKHR(queue.descriptor, &presentInfo) != VK_SUCCESS) + { + throw std::runtime_error("Unable to present swap chain image"); + } }