Before we can use a swapchain image, we need to ask a presentation engine for it. This process is called image acquisition. It returns an image's index into the array of images returned by the vkGetSwapchainImagesKHR() function as described in the Getting handles of swapchain images recipe.
Acquiring a swapchain image
Getting ready
To acquire an image in Vulkan, we need to specify one of two types of objects that haven't been described yet. These are semaphores and fences.
Semaphores are used to synchronize device's queues. It means that when we submit commands for processing, these commands may require another job to be finished. In such a situation, we can specify that these commands should wait for the other commands before they are executed. And...