pub enum AdapterPolicy {
Auto,
Performance,
Index(usize),
Name(String),
}Expand description
How the renderer’s adapter is chosen (ALPHA2_GPU_ADAPTER).
Variants§
Auto
Rank hardware adapters by GPU encode and decode, then high-performance order
(crate::rank_adapters). Requests without video context use the high-performance order
alone. The default on Linux and macOS.
Performance
The first hardware adapter in the high-performance order, whatever it encodes or decodes.
The default on Windows (Self::platform_default).
Index(usize)
The adapter at this position of its backend’s enumeration.
Name(String)
The first whose name contains this, ignoring case.
Implementations§
Source§impl AdapterPolicy
impl AdapterPolicy
Sourcepub const fn platform_default() -> Self
pub const fn platform_default() -> Self
The policy when ALPHA2_GPU_ADAPTER is unset: auto on Linux and macOS, performance on
Windows. On Windows auto often picks an Intel integrated GPU, where the bundled wgpu-hal
can leave DX12 textures uncleared, so auto there is opt-in.
Sourcepub fn parse(value: Option<&str>) -> Self
pub fn parse(value: Option<&str>) -> Self
The policy value names; unset and empty give Self::platform_default. Any other text
that is not a number is a name pin.
Sourcepub fn parse_set(value: Option<&str>) -> Option<Self>
pub fn parse_set(value: Option<&str>) -> Option<Self>
The policy value names, or None when it names none (unset or empty).
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
The policy ALPHA2_GPU_ADAPTER names, else Self::platform_default.
Sourcepub fn set_in_env() -> Option<Self>
pub fn set_in_env() -> Option<Self>
The policy ALPHA2_GPU_ADAPTER names, or None when it is unset.
Sourcepub fn names(&self, index: usize, name: &str) -> bool
pub fn names(&self, index: usize, name: &str) -> bool
Whether this pin names the adapter at enumeration position index called name.
Sourcepub fn report_name(&self) -> String
pub fn report_name(&self) -> String
The policy as a capability report names it: auto, performance, index:<n> or
name:<text>.
Trait Implementations§
Source§impl Clone for AdapterPolicy
impl Clone for AdapterPolicy
Source§impl Debug for AdapterPolicy
impl Debug for AdapterPolicy
impl Eq for AdapterPolicy
Source§impl PartialEq for AdapterPolicy
impl PartialEq for AdapterPolicy
impl StructuralPartialEq for AdapterPolicy
Auto Trait Implementations§
impl Freeze for AdapterPolicy
impl RefUnwindSafe for AdapterPolicy
impl Send for AdapterPolicy
impl Sync for AdapterPolicy
impl Unpin for AdapterPolicy
impl UnsafeUnpin for AdapterPolicy
impl UnwindSafe for AdapterPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.