Semaphores can be reused multiple times, so usually we don't need to delete them when the application is executing. But when we don't need a semaphore any more, and if we are sure it is not being used by the device (there are both no pending waits, and no pending signal operations), we can destroy it.
Destroying a semaphore
How to do it...
- Take the handle of a logical device. Store this handle in a variable of type VkDevice named logical_device.
- Initialize a variable of type VkSemaphore named semaphore with a handle of the semaphore that should be destroyed. Make sure it is not referenced by any submissions.
- Make the following call: vkDestroySemaphore( logical_device, semaphore, nullptr ), for which provide the logical device's handle, the handle...