Waiting for fences
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.
How to do it...
- Take the created logical device and use its handle to initialize a variable of type
VkDevice
namedlogical_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>
namedfences
. - Create a variable of type
VkBool32
namedwait_for_all
. Initialize it with a value ofVK_TRUE
, if the application should wait until all specified fences become signaled. If the application should wait until any of the fences becomes signaled (at least one of them), then initialize the variable with aVK_FALSE
value. - Create a variable of type
uint64_t
namedtimeout
. Initialize the variable with a value indicating how much time (in nanoseconds) the application should...