April 2017
Intermediate to advanced
700 pages
21h 36m
English
Samplers are destroyed like this:
if( VK_NULL_HANDLE != sampler ) {
vkDestroySampler( logical_device, sampler, nullptr );
sampler = VK_NULL_HANDLE;
}
We don't have to check whether the sampler's handle is not empty, because a deletion of a VK_NULL_HANDLE is ignored. We do this just to avoid an unnecessary function call. But when we delete a sampler, we must be sure that the handle (if not empty) is valid.
Read now
Unlock full access