pub struct GraphicsContextDescriptor {
pub backends: Backends,
pub power_preference: PowerPreference,
pub force_fallback_adapter: bool,
pub required_gpu_features: GpuFeatures,
pub requested_gpu_features: GpuFeatures,
pub additional_wgpu_features: Features,
pub limits: Limits,
pub label: Option<&'static str>,
}Expand description
Descriptor for configuring graphics context creation.
Fields§
§backends: BackendsGPU backends to use
power_preference: PowerPreferencePower preference for adapter selection
force_fallback_adapter: boolWhether to force fallback adapter
required_gpu_features: GpuFeaturesRequired GPU features (panics if not available).
Use this for features that your application cannot function without.
requested_gpu_features: GpuFeaturesRequested GPU features (best-effort, logs warning if unavailable).
Use this for features that would be nice to have but are not essential.
additional_wgpu_features: FeaturesAdditional raw wgpu features to enable (for features not covered by GpuFeatures).
limits: LimitsRequired device limits
label: Option<&'static str>Optional label for debugging
Implementations§
Source§impl GraphicsContextDescriptor
impl GraphicsContextDescriptor
Sourcepub fn require_features(self, features: GpuFeatures) -> Self
pub fn require_features(self, features: GpuFeatures) -> Self
Set required GPU features (panics if not available).
Sourcepub fn request_features(self, features: GpuFeatures) -> Self
pub fn request_features(self, features: GpuFeatures) -> Self
Set requested GPU features (best-effort, warns if unavailable).
Sourcepub fn with_required_features(self, features: GpuFeatures) -> Self
pub fn with_required_features(self, features: GpuFeatures) -> Self
Add additional required features.
Sourcepub fn with_requested_features(self, features: GpuFeatures) -> Self
pub fn with_requested_features(self, features: GpuFeatures) -> Self
Add additional requested features.
Sourcepub fn with_wgpu_features(self, features: Features) -> Self
pub fn with_wgpu_features(self, features: Features) -> Self
Set additional raw wgpu features (for features not covered by GpuFeatures).
Sourcepub fn power_preference(self, preference: PowerPreference) -> Self
pub fn power_preference(self, preference: PowerPreference) -> Self
Set the power preference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphicsContextDescriptor
impl RefUnwindSafe for GraphicsContextDescriptor
impl Send for GraphicsContextDescriptor
impl Sync for GraphicsContextDescriptor
impl Unpin for GraphicsContextDescriptor
impl UnwindSafe for GraphicsContextDescriptor
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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