VKCREATESWAPCHAINKHR(3)

NAME
vkCreateSwapchainKHR - Create a swapchain

C SPECIFICATION

To create a swapchain, call:

    VkResult vkCreateSwapchainKHR(
        VkDevice                                    device,
        const VkSwapchainCreateInfoKHR*             pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkSwapchainKHR*                             pSwapchain);

PARAMETERS

    • device is the device to create the swapchain for.

    • pCreateInfo is a pointer to an instance of the VkSwapchainCreateInfoKHR structure specifying the parameters of the created swapchain.

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

    • pSwapchain is a pointer to a VkSwapchainKHR handle in which the created swapchain object will be returned.

DESCRIPTION

VALID USAGE

    • device must be a valid VkDevice handle

    • pCreateInfo must be a pointer to a valid VkSwapchainCreateInfoKHR structure

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

    • pSwapchain must be a pointer to a VkSwapchainKHR handle

HOST SYNCHRONIZATION

    • Host access to pCreateInfo.surface must be externally synchronized

    • Host access to pCreateInfo.oldSwapchain must be externally synchronized

RETURN CODES

On success, this command returns

        • VK_SUCCESS

On failure, this command returns

        • VK_ERROR_OUT_OF_HOST_MEMORY

        • VK_ERROR_OUT_OF_DEVICE_MEMORY

        • VK_ERROR_DEVICE_LOST

        • VK_ERROR_SURFACE_LOST_KHR

        • VK_ERROR_NATIVE_WINDOW_IN_USE_KHR

SEE ALSO

VkAllocationCallbacks, VkDevice, VkSwapchainCreateInfoKHR, VkSwapchainKHR

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.