vkDestroyDevice
To destroy a device, call:
void vkDestroyDevice(
VkDevice device,
const VkAllocationCallbacks* pAllocator);
pub fn destroy_device(
device: vk::Device,
p_allocator: *const vk::AllocationCallbacks,
);
deviceis the logical device to destroy.pAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.
To ensure that no work is active on the device, vkDeviceWaitIdle can
be used to gate the destruction of the device.
Prior to destroying a device, an application is responsible for
destroying/freeing any Vulkan objects with explicit vkDestroy* or
vkFree* commands that were created using that device as the first
parameter of the corresponding vkCreate* or vkAllocate* command.
VkDevice object.
Therefore, to avoid resource leaks, it is critical that an application
explicitly free all of these resources prior to calling
vkDestroyDevice.Valid Usage
VUID-vkDestroyDevice-device-05137
All child objects created on device that can be destroyed or freed
must have been destroyed or freed prior to destroying device
VUID-vkDestroyDevice-device-00379
If VkAllocationCallbacks were provided when device was
created, a compatible set of callbacks must be provided here
VUID-vkDestroyDevice-device-00380
If no VkAllocationCallbacks were provided when device was
created, pAllocator must be NULL
Valid Usage (Implicit)
VUID-vkDestroyDevice-device-parameter
If device is not NULL, device must be a valid VkDevice handle
VUID-vkDestroyDevice-pAllocator-parameter
If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
Host Synchronization
- Host access to
devicemust be externally synchronized - Host access to all
VkQueueobjects created fromdevicemust be externally synchronized