pub struct DeviceBuilder { /* private fields */ }Implementations§
Source§impl DeviceBuilder
impl DeviceBuilder
pub fn new( physical_device: PhysicalDevice, instance: Arc<Instance>, ) -> DeviceBuilder
pub fn allocation_callbacks( self, allocation_callbacks: AllocationCallbacks, ) -> Self
Sourcepub fn build(self) -> Result<Device>
pub fn build(self) -> Result<Device>
Create a logical Device from the configured PhysicalDevice.
What this does:
- Builds queue create infos for each discovered queue family (default priority 1.0).
- Enables any device extensions that were marked on the
PhysicalDevice(and theVK_KHR_swapchainextension when a surface is present or surface init is deferred). - Pushes a
vk::PhysicalDeviceFeatures2and any requested feature-chain nodes onto the device create pNext chain when the instance supports properties2 or is Vulkan 1.1+. - Calls
vkCreateDeviceand returns aDevicewrapper on success.
Returns:
Ok(Device)containing the createdvulkanalia::Device, retainedInstanceand selectedPhysicalDeviceinformation.- An error if device creation fails.
Notes:
- Queue configuration is simplified: every queue family discovered by the physical device is created with a single queue at priority 1.0. Customize if you need different priorities or explicit queue counts.
- Any allocation callbacks previously set via
DeviceBuilder::allocation_callbacksare forwarded tovkCreateDeviceand stored in the returnedDevice.
Auto Trait Implementations§
impl Freeze for DeviceBuilder
impl !RefUnwindSafe for DeviceBuilder
impl Send for DeviceBuilder
impl Sync for DeviceBuilder
impl Unpin for DeviceBuilder
impl !UnwindSafe for DeviceBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more