pub struct SurfaceBootstrapConfig {
pub requested_backends: Backends,
pub allow_fallback_backends: bool,
pub preferred_backends: Backends,
pub power_preference: PowerPreference,
pub force_fallback_adapter: bool,
}Expand description
Configuration used when bootstrapping GPU instances/adapters.
Defaults request all backends, prefer primary backends and high performance, allow backend fallback, and do not force a software adapter.
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::SurfaceBootstrapConfig;
let config = SurfaceBootstrapConfig::default();
assert_eq!(config.requested_backends, wgpu::Backends::all());
assert!(config.allow_fallback_backends);Fields§
§requested_backends: BackendsBackends to request explicitly from wgpu.
allow_fallback_backends: boolAllow falling back to non-requested backends.
preferred_backends: BackendsPreferred backend for ranking candidates.
power_preference: PowerPreferencePower preference used when requesting devices.
force_fallback_adapter: boolWhether to request a fallback adapter if the preferred backend cannot be opened.
Implementations§
Source§impl SurfaceBootstrapConfig
impl SurfaceBootstrapConfig
Sourcepub fn with_requested_backends(requested: Backends) -> Self
pub fn with_requested_backends(requested: Backends) -> Self
Explicit backend selection by environment (no fallback to non-requested backends).
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::SurfaceBootstrapConfig;
let config = SurfaceBootstrapConfig::with_requested_backends(wgpu::Backends::GL);
assert_eq!(config.requested_backends, wgpu::Backends::GL);
assert!(!config.allow_fallback_backends);Sourcepub fn vulkan_first() -> Self
pub fn vulkan_first() -> Self
Vulkan-first bootstrap with fallback to other available backends.
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::SurfaceBootstrapConfig;
let config = SurfaceBootstrapConfig::vulkan_first();
assert_eq!(config.requested_backends, wgpu::Backends::VULKAN);
assert!(config.allow_fallback_backends);Sourcepub fn vulkan_only() -> Self
pub fn vulkan_only() -> Self
Vulkan-only bootstrap (strict, no fallback).
§Examples
use ailloli_ui_render_wgpu::pipeline_cache::SurfaceBootstrapConfig;
let config = SurfaceBootstrapConfig::vulkan_only();
assert_eq!(config.preferred_backends, wgpu::Backends::VULKAN);
assert!(!config.allow_fallback_backends);Trait Implementations§
Source§impl Clone for SurfaceBootstrapConfig
impl Clone for SurfaceBootstrapConfig
Source§fn clone(&self) -> SurfaceBootstrapConfig
fn clone(&self) -> SurfaceBootstrapConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SurfaceBootstrapConfig
impl Debug for SurfaceBootstrapConfig
Source§impl Default for SurfaceBootstrapConfig
impl Default for SurfaceBootstrapConfig
impl Copy for SurfaceBootstrapConfig
Auto Trait Implementations§
impl Freeze for SurfaceBootstrapConfig
impl RefUnwindSafe for SurfaceBootstrapConfig
impl Send for SurfaceBootstrapConfig
impl Sync for SurfaceBootstrapConfig
impl Unpin for SurfaceBootstrapConfig
impl UnwindSafe for SurfaceBootstrapConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().