pub struct WgpuSettings {Show 15 fields
pub device_label: Option<Cow<'static, str>>,
pub backends: Option<Backends>,
pub power_preference: PowerPreference,
pub priority: WgpuSettingsPriority,
pub features: WgpuFeatures,
pub disabled_features: Option<WgpuFeatures>,
pub limits: WgpuLimits,
pub constrained_limits: Option<WgpuLimits>,
pub dx12_shader_compiler: Dx12Compiler,
pub gles3_minor_version: Gles3MinorVersion,
pub instance_flags: InstanceFlags,
pub memory_hints: MemoryHints,
pub instance_memory_budget_thresholds: MemoryBudgetThresholds,
pub force_fallback_adapter: bool,
pub adapter_name: Option<String>,
}Expand description
Provides configuration for renderer initialization. Use RenderDevice::features,
RenderDevice::limits, and the RenderAdapterInfo
resource to get runtime information about the actual adapter, backend, features, and limits.
NOTE: Backends::DX12, Backends::METAL, and
Backends::VULKAN are enabled by default for non-web and the best choice
is automatically selected. Web using the webgl feature uses Backends::GL.
NOTE: If you want to use Backends::GL in a native app on Windows and/or macOS, you must
use ANGLE and enable the gles feature. This is
because wgpu requires EGL to create a GL context without a window and only ANGLE supports that.
Fields§
§device_label: Option<Cow<'static, str>>§backends: Option<Backends>§power_preference: PowerPreference§priority: WgpuSettingsPriority§features: WgpuFeaturesThe features to ensure are enabled regardless of what the adapter/backend supports. Setting these explicitly may cause renderer initialization to fail.
disabled_features: Option<WgpuFeatures>The features to ensure are disabled regardless of what the adapter/backend supports
limits: WgpuLimitsThe imposed limits.
constrained_limits: Option<WgpuLimits>The constraints on limits allowed regardless of what the adapter/backend supports
dx12_shader_compiler: Dx12CompilerThe shader compiler to use for the DX12 backend.
gles3_minor_version: Gles3MinorVersionAllows you to choose which minor version of GLES3 to use (3.0, 3.1, 3.2, or automatic) This only applies when using ANGLE and the GL backend.
instance_flags: InstanceFlagsThese are for controlling WGPU’s debug information to eg. enable validation and shader debug info in release builds.
memory_hints: MemoryHintsThis hints to the WGPU device about the preferred memory allocation strategy.
instance_memory_budget_thresholds: MemoryBudgetThresholdsThe thresholds for device memory budget.
force_fallback_adapter: boolIf true, will force wgpu to use a software renderer, if available.
adapter_name: Option<String>The name of the adapter to use.
Trait Implementations§
Source§impl Clone for WgpuSettings
impl Clone for WgpuSettings
Source§fn clone(&self) -> WgpuSettings
fn clone(&self) -> WgpuSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for WgpuSettings
impl Default for WgpuSettings
Source§impl From<WgpuSettings> for RenderCreation
impl From<WgpuSettings> for RenderCreation
Source§fn from(value: WgpuSettings) -> Self
fn from(value: WgpuSettings) -> Self
Auto Trait Implementations§
impl Freeze for WgpuSettings
impl RefUnwindSafe for WgpuSettings
impl Send for WgpuSettings
impl Sync for WgpuSettings
impl Unpin for WgpuSettings
impl UnwindSafe for WgpuSettings
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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,
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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