Function Prototype

vkDestroyBuffer

Destroy a buffer object

To destroy a buffer, call:

void vkDestroyBuffer(
    VkDevice device,
    VkBuffer buffer,
    const VkAllocationCallbacks* pAllocator);
  • device is the logical device that destroys the buffer.
  • buffer is the buffer to destroy.
  • pAllocator controls host memory allocation as described in the Memory Allocation chapter.

Valid Usage

VUID-vkDestroyBuffer-buffer-00922

All submitted commands that refer to buffer, either directly or via a VkBufferView, must have completed execution

VUID-vkDestroyBuffer-buffer-00923

If VkAllocationCallbacks were provided when buffer was created, a compatible set of callbacks must be provided here

VUID-vkDestroyBuffer-buffer-00924

If no VkAllocationCallbacks were provided when buffer was created, pAllocator must be NULL

Valid Usage (Implicit)

VUID-vkDestroyBuffer-device-parameter

device must be a valid VkDevice handle

VUID-vkDestroyBuffer-buffer-parameter

If buffer is not VK_NULL_HANDLE, buffer must be a valid VkBuffer handle

VUID-vkDestroyBuffer-pAllocator-parameter

If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure

VUID-vkDestroyBuffer-buffer-parent

If buffer is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to buffer must be externally synchronized ::