Struct erupt_bootstrap::device::DeviceBuilder
source · [−]pub struct DeviceBuilder<'a> { /* private fields */ }Expand description
Allows to easily create an erupt::InstanceLoader and queues.
Implementations
Create a new device builder with a custom DeviceLoaderBuilder.
Specify a custom queue setup.
Default setup
|physical_device, queue_family_requirements, queue_family_properties| {
let mut queue_setup = HashSet::with_capacity(queue_family_requirements.len());
for queue_family_requirements in queue_family_requirements {
match queue_family_requirements.queue_family(
instance,
physical_device,
queue_family_properties,
self.surface,
)? {
Some((idx, _properties)) => {
queue_setup.insert(QueueSetup::simple(idx, 1));
}
None => return Ok(None),
}
}
Ok(Some(queue_setup))
}pub fn additional_suitability(
self,
additional_suitability: Box<AdditionalSuitabilityFn>
) -> Self
pub fn additional_suitability(
self,
additional_suitability: Box<AdditionalSuitabilityFn>
) -> Self
Allows to specify custom criteria for a physical device. This can for example be used to check for limits.
Surface to use to check for presentation support in queue families.
Prioritise devices of these types when choosing a device. The further ahead, the higher the priority.
pub fn require_queue_family(
self,
queue_family_requirements: QueueFamilyRequirements
) -> Self
pub fn require_queue_family(
self,
queue_family_requirements: QueueFamilyRequirements
) -> Self
Requires a queue family that meets the requirements to be present.
Prefer a device which has at least one DEVICE_LOCAL memory heap with
a minimum of size bytes of memory.
Require a device which has at least one DEVICE_LOCAL memory heap with
a minimum of size bytes of memory.
Prefer a device which supports extension.
The extension will only be enabled if it’s supported.
Require a device which supports extension.
The extension will be enabled.
Prefer a device which supports this version.
Prefer a device which supports this version.
Require the device to support this version.
Require the device to support this version.
Require these features to be present for the device. The elements of the pointer chain will only be considered if possible. The features will be enabled.
Skip the selection logic and always select the physical device at the specified index.
Allocation callback to use for internal Vulkan calls in the builder.
pub unsafe fn build(
self,
instance: &'a InstanceLoader,
instance_metadata: &InstanceMetadata
) -> Result<(DeviceLoader, DeviceMetadata), DeviceCreationError>
pub unsafe fn build(
self,
instance: &'a InstanceLoader,
instance_metadata: &InstanceMetadata
) -> Result<(DeviceLoader, DeviceMetadata), DeviceCreationError>
Returns the erupt::DeviceLoader and DeviceMetadata, containing
the handle of the used physical device handle and its properties, as
wells as the enabled device extensions and used queue setups.