VKCREATEDEVICE(3)

NAME
vkCreateDevice - Create a new device instance

C SPECIFICATION

A logical device is created as a connection to a physical device. To create a logical device, call:

    VkResult vkCreateDevice(
        VkPhysicalDevice                            physicalDevice,
        const VkDeviceCreateInfo*                   pCreateInfo,
        const VkAllocationCallbacks*                pAllocator,
        VkDevice*                                   pDevice);

PARAMETERS

    • physicalDevice must be one of the device handles returned from a call to vkEnumeratePhysicalDevices (see Physical Device Enumeration).

    • pCreateInfo is a pointer to a VkDeviceCreateInfo structure containing information about how to create the device.

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

    • pDevice points to a handle in which the created VkDevice is returned.

DESCRIPTION

Multiple logical devices can be created from the same physical device. Logical device creation may fail due to lack of device-specific resources (in addition to the other errors). If that occurs, vkCreateDevice will return VK_ERROR_TOO_MANY_OBJECTS. Valid Usage (Implicit)

    • physicalDevice must be a valid VkPhysicalDevice handle

    • pCreateInfo must be a pointer to a valid VkDeviceCreateInfo structure

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

    • pDevice must be a pointer to a VkDevice 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_EXTENSION_NOT_PRESENT

        • VK_ERROR_FEATURE_NOT_PRESENT

        • VK_ERROR_TOO_MANY_OBJECTS

        • VK_ERROR_DEVICE_LOST

SEE ALSO

VkAllocationCallbacks, VkDevice, VkDeviceCreateInfo, VkPhysicalDevice

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.