vkCreateDevice
vkCreateDevice is a Vulkan API function used to create a logical device from a physical device. The logical device serves as the main handle through which an application interacts with the GPU, submits commands, and allocates device resources. Creating the device enables a specified set of device features, queue families, and extensions, and allocates per-device resources. The function returns a VkDevice handle on success and a VkResult error code on failure, such as VK_SUCCESS, VK_ERROR_OUT_OF_HOST_MEMORY, VK_ERROR_OUT_OF_DEVICE_MEMORY, VK_ERROR_EXTENSION_NOT_PRESENT, VK_ERROR_FEATURE_NOT_PRESENT, or VK_ERROR_INITIALIZATION_FAILED.
- physicalDevice: the VkPhysicalDevice object representing the target GPU.
- pCreateInfo: a pointer to a VkDeviceCreateInfo structure describing the queues to create, enabled device features, and
- pAllocator: optional allocation callbacks; can be NULL to use the default allocator.
- pDevice: pointer to a VkDevice handle that will receive the created logical device.
The VkDeviceCreateInfo structure specifies, among other things, queueCreateInfoCount and pQueueCreateInfos to declare which queue families and
VkDevice, VkDeviceCreateInfo, VkPhysicalDevice, vkGetDeviceQueue.