VKDESTROYSWAPCHAINKH(3)

NAME
vkDestroySwapchainKHR - Destroy a swapchain object

C SPECIFICATION

To destroy a swapchain object call:

    void vkDestroySwapchainKHR(
        VkDevice                                    device,
        VkSwapchainKHR                              swapchain,
        const VkAllocationCallbacks*                pAllocator);

PARAMETERS

    • device is the VkDevice assocated with swapchain.

    • swapchain is the swapchain to destroy.

    • pAllocator is the allocator used for host memory allocated for the swapchain object when there is no more specific allocator available (see Memory Allocation).

DESCRIPTION

swapchain and all associated VkImage handles are destroyed, and must not be acquired or used any more by the application. The memory of each VkImage will only be freed after that image is no longer used by the platform. For example, if one image of the swapchain is being displayed in a window, the memory for that image may not be freed until the window is destroyed, or another swapchain is created for the window. Destroying the swapchain does not invalidate the parent VkSurfaceKHR, and a new swapchain can be created with it.

If a swapchain associated with a display surface is destroyed and there are no valid descendants of that swapchain, the implementation must either revert any display resources modified by presenting images with the swapchain to their state prior to the first present performed with the swapchain and its ancestors, or leave such resources in their current state.

VALID USAGE

    • device must be a valid VkDevice handle

    • If swapchain is not VK_NULL_HANDLE, swapchain must be a valid VkSwapchainKHR handle

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

    • All uses of presentable images acquired from swapchain must have completed execution

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

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

HOST SYNCHRONIZATION

    • Host access to swapchain must be externally synchronized

SEE ALSO

VkAllocationCallbacks, VkDevice, VkSwapchainKHR

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkDestroySwapchainKHR

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.