Skip to main content

create_device

Function create_device 

Source
pub unsafe fn create_device(
    instance: &Instance,
    physical_device: PhysicalDevice,
    create_info: &DeviceCreateInfo<'_>,
    allocator: Option<&AllocationCallbacks>,
) -> Result<Device, CallError>
Expand description

Create a logical device from a physical device.

§Errors

Reports preflight/metadata failures, driver errors, invalid native outputs and unavailable destruction. If rollback is impossible, CallError::InitializationFailed retains the device for explicit recovery.

§Safety

The create info, its reachable pointers and allocator callbacks must meet Vulkan valid usage. Allocator state must remain alive until destruction.

Khronos reference: vkCreateDevice