When we want to synchronize the application with work submitted to a selected queue, we don't always have to use fences. It is possible for the application to wait until all tasks submitted to a selected queue are finished.
Waiting until all commands submitted to a queue are finished
How to do it...
- Take the handle of the queue into which tasks were submitted. Store it in a variable of type VkQueue named queue.
- Call vkQueueWaitIdle( queue ) and provide the queue variable.
- We can make sure that no errors occurred by checking if the value returned by the call is equal to a VK_SUCCESS.
How it works...
The vkQueueWaitIdle...