pub struct PhysicalDeviceSelector { /* private fields */ }Implementations§
Source§impl PhysicalDeviceSelector
impl PhysicalDeviceSelector
Sourcepub fn new(instance: Arc<Instance>) -> PhysicalDeviceSelector
pub fn new(instance: Arc<Instance>) -> PhysicalDeviceSelector
Create a new PhysicalDeviceSelector for the provided Instance.
The selector can be configured with builder-style methods before calling select.
Sourcepub fn surface(self, surface: SurfaceKHR) -> Self
pub fn surface(self, surface: SurfaceKHR) -> Self
Specify a surface to use when evaluating device presentation support.
Sourcepub fn add_required_extension_feature<T: Into<VulkanPhysicalDeviceFeature2>>(
self,
feature: T,
) -> Self
pub fn add_required_extension_feature<T: Into<VulkanPhysicalDeviceFeature2>>( self, feature: T, ) -> Self
Add an additional device feature (vulkan feature2 struct) that must be supported by the physical device in order to be selected.
Sourcepub fn add_required_features(self, features: PhysicalDeviceFeatures) -> Self
pub fn add_required_features(self, features: PhysicalDeviceFeatures) -> Self
Require the given vk::PhysicalDeviceFeatures when selecting a physical device.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Restrict selection to devices whose name matches name.
Sourcepub fn preferred_device_type(self, device_type: PreferredDeviceType) -> Self
pub fn preferred_device_type(self, device_type: PreferredDeviceType) -> Self
Prefer devices of the given PreferredDeviceType when ranking candidates.
Sourcepub fn allow_any_gpu_device_type(self, allow: bool) -> Self
pub fn allow_any_gpu_device_type(self, allow: bool) -> Self
Allow devices of any GPU type (when true) or restrict to the preferred device type.
Sourcepub fn require_dedicated_transfer_queue(self, require: bool) -> Self
pub fn require_dedicated_transfer_queue(self, require: bool) -> Self
Require a dedicated transfer-only queue family to be present on the physical device.
Sourcepub fn require_dedicated_compute_queue(self, require: bool) -> Self
pub fn require_dedicated_compute_queue(self, require: bool) -> Self
Require a dedicated compute-only queue family to be present on the physical device.
Sourcepub fn require_separate_transfer_queue(self, require: bool) -> Self
pub fn require_separate_transfer_queue(self, require: bool) -> Self
Require a queue family separate from graphics for transfer operations.
Sourcepub fn require_separate_compute_queue(self, require: bool) -> Self
pub fn require_separate_compute_queue(self, require: bool) -> Self
Require a queue family separate from graphics for compute operations.
Sourcepub fn required_device_memory_size(self, required: DeviceSize) -> Self
pub fn required_device_memory_size(self, required: DeviceSize) -> Self
Require the device to have at least required bytes of device-local memory.
Sourcepub fn required_formats(
self,
required: impl IntoIterator<Item = Format>,
) -> Self
pub fn required_formats( self, required: impl IntoIterator<Item = Format>, ) -> Self
Require support for the provided list of vk::Formats on the device’s surface.
Sourcepub fn select_first_device_unconditionally(self, select: bool) -> Self
pub fn select_first_device_unconditionally(self, select: bool) -> Self
If select is true, automatically select the first enumerated physical device
without applying suitability checks.
Sourcepub fn select(self) -> Result<PhysicalDevice>
pub fn select(self) -> Result<PhysicalDevice>
Select a suitable PhysicalDevice according to the configured criteria.
Returns a PhysicalDevice on success or an error if no suitable device could be found.