When we no longer need a sampler and we are sure it is not used anymore by the pending commands, we can destroy it.
Destroying a sampler
How to do it...
- Take the handle of a logical device on which the sampler was created and store it in a variable of type VkDevice named logical_device.
- Take the handle of the sampler that should be destroyed. Provide it through a variable of type VkSampler named sampler.
- Call vkDestroySampler( logical_device, sampler, nullptr ) and provide the logical_device and sampler variables, and a nullptr value.
- For safety, assign the VK_NULL_HANDLE value to the sampler variable.