VKCREATEINSTANCE(3)

NAME
vkCreateInstance - Create a new Vulkan instance

C SPECIFICATION

To create an instance object, call:

    VkResult vkCreateInstance(
        const VkInstanceCreateInfo*                 pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkInstance*                                 pInstance);

PARAMETERS

    • pCreateInfo points to an instance of VkInstanceCreateInfo controlling creation of the instance.

    • pAllocator controls host memory allocation as described in the Memory Allocation chapter.

    • pInstance points a VkInstance handle in which the resulting instance is returned.

DESCRIPTION

vkCreateInstance creates the instance, then enables and initializes global layers and extensions requested by the application. If an extension is provided by a layer, both the layer and extension must be specified at vkCreateInstance time. If a specified layer cannot be found, no VkInstance will be created and the function will return VK_ERROR_LAYER_NOT_PRESENT. Likewise, if a specified extension cannot be found the call will return VK_ERROR_EXTENSION_NOT_PRESENT.

VALID USAGE

    • pCreateInfo must be a pointer to a valid VkInstanceCreateInfo structure

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

    • pInstance must be a pointer to a VkInstance handle

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_INITIALIZATION_FAILED

        • VK_ERROR_LAYER_NOT_PRESENT

        • VK_ERROR_EXTENSION_NOT_PRESENT

        • VK_ERROR_INCOMPATIBLE_DRIVER

SEE ALSO

VkAllocationCallbacks, VkInstance, VkInstanceCreateInfo

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.