Struct re_renderer::config::DeviceCaps
source · pub struct DeviceCaps {
pub tier: DeviceTier,
pub max_texture_dimension2d: u32,
pub max_buffer_size: u64,
pub backend_type: WgpuBackendType,
}
Expand description
Capabilities of a given device.
Generally, this is a higher level interpretation of [wgpu::Limits
] & [wgpu::Features
].
We’re trying to keep the number of fields in this struct to a minimum and associate as many as possible capabilities with the device tier.
Fields§
§tier: DeviceTier
§max_texture_dimension2d: u32
Maximum texture dimension in pixels in both width and height.
Since this has a direct effect on the image sizes & screen resolution a user can use, we always pick the highest possible.
max_buffer_size: u64
Maximum buffer size in bytes.
Since this has a direct effect on how much data a user can wrangle on the gpu, we always pick the highest possible.
backend_type: WgpuBackendType
Wgpu backend type.
Prefer using tier
and other properties of this struct for distinguishing between abilities.
This is useful for making wgpu-core/webgpu api path decisions.
Implementations§
source§impl DeviceCaps
impl DeviceCaps
sourcepub fn from_adapter_without_validation(adapter: &Adapter) -> Self
pub fn from_adapter_without_validation(adapter: &Adapter) -> Self
Picks the highest possible tier for a given adapter, but doesn’t validate that all the capabilities needed are there.
This is really only needed for generating a device descriptor for Self::device_descriptor
.
See also use of egui_wgpu::WgpuSetup::CreateNew
sourcepub fn from_adapter(
adapter: &Adapter,
) -> Result<Self, InsufficientDeviceCapabilities>
pub fn from_adapter( adapter: &Adapter, ) -> Result<Self, InsufficientDeviceCapabilities>
Picks the highest possible tier for a given adapter.
Note that it is always possible to pick a lower tier!
sourcepub fn device_descriptor(&self) -> DeviceDescriptor<'static>
pub fn device_descriptor(&self) -> DeviceDescriptor<'static>
Device descriptor compatible with the given device tier.
Trait Implementations§
source§impl Clone for DeviceCaps
impl Clone for DeviceCaps
source§fn clone(&self) -> DeviceCaps
fn clone(&self) -> DeviceCaps
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DeviceCaps
impl Debug for DeviceCaps
source§impl PartialEq for DeviceCaps
impl PartialEq for DeviceCaps
source§fn eq(&self, other: &DeviceCaps) -> bool
fn eq(&self, other: &DeviceCaps) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for DeviceCaps
impl StructuralPartialEq for DeviceCaps
Auto Trait Implementations§
impl Freeze for DeviceCaps
impl RefUnwindSafe for DeviceCaps
impl Send for DeviceCaps
impl Sync for DeviceCaps
impl Unpin for DeviceCaps
impl UnwindSafe for DeviceCaps
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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.§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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