Fences, opposite to semaphores, are used to synchronize an application with commands submitted to the graphics hardware. They inform the application when the processing of a submitted work has been finished. But before we can use fences, we need to create them.
Creating a fence
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 variable of type VkFenceCreateInfo named fence_create_info. Use the following values to initialize its members:
- VK_STRUCTURE_TYPE_FENCE_CREATE_INFO value for sType
- nullptr value for pNext
- For flags use a 0 value if a created fence should be un-signaled, or a VK_FENCE_CREATE_SIGNALED_BIT value if a created fence should be signaled
- Create a variable...