Fences can be reused multiple times. But when we don't need them anymore, typically just before we close our application, we should destroy them.
Destroying a fence
How to do it...
- Take the handle of a logical device and store it in a variable of type VkDevice named logical_device.
- Take the handle of a fence that should be destroyed. Use the handle to initialize a variable of type VkFence named fence.
- Call vkDestroyFence( logical_device, fence, nullptr ) and provide the logical device's handle, the fence variable and a nullptr value.
- For safety reasons, assign the VK_NULL_HANDLE value to the fence variable.