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,
pub gles3_minor_version: Gles3MinorVersion,
pub instance_flags: InstanceFlags,
}
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.
gles3_minor_version: Gles3MinorVersion
Allows 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: InstanceFlags
These are for controlling WGPU’s debug information to eg. enable validation and shader debug info in release builds.
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> 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> 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
.