VKCREATEDEVICE(3)

NAME
vkCreateDevice - Create a new device instance.

C SPECIFICATION

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

PARAMETERS

physicalDevice
    Handle to the physical device upon which to create the logical device.

pCreateInfo
    Pointer to a structure containing creation info.

pDevice
    Pointer to a variable to receive the handle to the new device instance.

DESCRIPTION

vkCreateDevice creates a new device instance on the physical device specified by physicalDevice and places the resulting device handle in the variable pointed to by pDevice. Information about how the device should be created is passed in an instance of VkDeviceCreateInfo whose address is passed in pCreateInfo. The definition of VkDeviceCreateInfo is:

    typedef struct VkDeviceCreateInfo {
        VkStructureType                    sType;
        const void*                        pNext;
        VkDeviceCreateFlags                flags;
        uint32_t                           queueCreateInfoCount;
        const VkDeviceQueueCreateInfo*     pQueueCreateInfos;
        uint32_t                           enabledLayerCount;
        const char* const*                 ppEnabledLayerNames;
        uint32_t                           enabledExtensionCount;
        const char* const*                 ppEnabledExtensionNames;
        const VkPhysicalDeviceFeatures*    pEnabledFeatures;
    } VkDeviceCreateInfo;

VALID USAGE

    • 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_LAYER_NOT_PRESENT

        • VK_ERROR_EXTENSION_NOT_PRESENT

        • VK_ERROR_FEATURE_NOT_PRESENT

        • VK_ERROR_TOO_MANY_OBJECTS

        • VK_ERROR_DEVICE_LOST

SEE ALSO

vkDestroyDevice

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.