imageIndexInFlight is now initialized properly

This commit is contained in:
OLEGSHA 2022-11-04 22:51:36 +03:00
parent a110c9de03
commit 189d19fd4a
Signed by: OLEGSHA
GPG Key ID: E57A4B08D64AFF7A

View File

@ -49,6 +49,7 @@ bool Frame::startRender() {
vkWaitForFences(vulkan.getDevice(), 1, &inFlightFence, VK_TRUE, UINT64_MAX);
// Acquire an image
imageIndexInFlight = 0;
VkResult result = vkAcquireNextImageKHR(
vulkan.getDevice(), vulkan.getSwapChain().getVk(), UINT64_MAX,
imageAvailableSemaphore, VK_NULL_HANDLE, &*imageIndexInFlight);
@ -163,6 +164,8 @@ void Frame::endRender() {
} else {
vulkan.handleVkResult("Could not present", result);
}
imageIndexInFlight.reset();
}
VkCommandBuffer Frame::getCommandBuffer() { return commandBuffer; }