When we want to know when the processing of submitted commands is finished, we need to use a fence and provide it during command buffer submission. Then, the application can check the fence's state and wait until it becomes signaled.
Waiting for fences
How to do it...
- Take the created logical device and use its handle to initialize a variable of type VkDevice named logical_device.
- Create a list of fences on which the application should wait. Store the handles of all fences in a variable of type std::vector<VkFence> named fences.
- Create a variable of type VkBool32 named wait_for_all. Initialize it with a value of VK_TRUE, if the application should wait until all specified fences become signaled. If the application should wait until any of the fences becomes...