pub enum AdapterChoice {
Default,
Software,
HighPerformance,
Named(String),
Index(usize),
}Expand description
Which graphics adapter a headless context should render on.
Stated in wgpu’s own vocabulary and nothing else: no platform type, no
vendor branch, no backend branch, so core stays GPU-abstract (ADR-0001)
while still letting a shell say which GPU it means.
The variants are not interchangeable views of one preference. The first three ask wgpu to choose and accept whatever it returns; the last two name one adapter out of the enumerated roster and fail if it is not there.
Variants§
Default
Whatever wgpu picks with default options. On a hybrid machine this is
the power-saving GPU for a console process, which is why a live path
wants HighPerformance instead.
The Default impl resolves here, which is what keeps every caller
that does not care — the C ABI window path included — asking for exactly
what it asked for before the choice existed.
Software
Force a fallback (software) adapter - WARP on DX12 - so captures rasterize identically across machines. What the golden suite asks for.
HighPerformance
PowerPreference::HighPerformance: the discrete GPU on a hybrid
machine.
Named(String)
The one enumerated adapter whose name contains this string, matched case-insensitively. More than one match is an error, not a pick.
Index(usize)
The adapter at this position in list_adapters’s roster.
Trait Implementations§
Source§impl Clone for AdapterChoice
impl Clone for AdapterChoice
Source§fn clone(&self) -> AdapterChoice
fn clone(&self) -> AdapterChoice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AdapterChoice
impl Debug for AdapterChoice
Source§impl Default for AdapterChoice
impl Default for AdapterChoice
Source§fn default() -> AdapterChoice
fn default() -> AdapterChoice
Source§impl From<bool> for AdapterChoice
impl From<bool> for AdapterChoice
Source§impl PartialEq for AdapterChoice
impl PartialEq for AdapterChoice
Source§fn eq(&self, other: &AdapterChoice) -> bool
fn eq(&self, other: &AdapterChoice) -> bool
self and other values to be equal, and is used by ==.impl Eq for AdapterChoice
impl StructuralPartialEq for AdapterChoice
Auto Trait Implementations§
impl Freeze for AdapterChoice
impl RefUnwindSafe for AdapterChoice
impl Send for AdapterChoice
impl Sync for AdapterChoice
impl Unpin for AdapterChoice
impl UnsafeUnpin for AdapterChoice
impl UnwindSafe for AdapterChoice
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.