Struct bevy_render::settings::WgpuSettings
source · pub struct WgpuSettings {
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,
}
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
. 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: WgpuFeatures
The 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: WgpuLimits
The imposed limits.
constrained_limits: Option<WgpuLimits>
The constraints on limits allowed regardless of what the adapter/backend supports
dx12_shader_compiler: Dx12Compiler
The shader compiler to use for the DX12 backend.
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 moreAuto Trait Implementations§
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 Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
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, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
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> 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
Self
using data from the given World