April 2017
Intermediate to advanced
700 pages
21h 36m
English
Fences are destroyed using the vkDestroyFence() function, like this:
if( VK_NULL_HANDLE != fence ) {
vkDestroyFence( logical_device, fence, nullptr );
fence = VK_NULL_HANDLE;
}
We don't need to check if a value of the fence variable is not equal to the VK_NULL_HANDLE value because destruction of a null handle will be ignored by the driver. But, we do this to skip an unnecessary function call.
But, we can't destroy an invalid object - an object that wasn't created on a given logical device or that has already been destroyed. That's why we assign a VK_NULL_HANDLE value to the variable with the fence's handle.
Read now
Unlock full access