Struct bevy_render::render_resource::Extent3d
source · #[repr(C)]pub struct Extent3d {
pub width: u32,
pub height: u32,
pub depth_or_array_layers: u32,
}
Expand description
Extent of a texture related operation.
Corresponds to WebGPU GPUExtent3D
.
Fields§
§width: u32
Width of the extent
height: u32
Height of the extent
depth_or_array_layers: u32
The depth of the extent or the number of array layers
Implementations§
source§impl Extent3d
impl Extent3d
sourcepub fn physical_size(&self, format: TextureFormat) -> Extent3d
pub fn physical_size(&self, format: TextureFormat) -> Extent3d
Calculates the physical size backing a texture of the given format and extent. This includes padding to the block width and height of the format.
This is the texture extent that you must upload at when uploading to mipmaps of compressed textures.
sourcepub fn max_mips(&self, dim: TextureDimension) -> u32
pub fn max_mips(&self, dim: TextureDimension) -> u32
Calculates the maximum possible count of mipmaps.
Treats the depth as part of the mipmaps. If calculating for a 2DArray texture, which does not mipmap depth, set depth to 1.
sourcepub fn mip_level_size(&self, level: u32, dim: TextureDimension) -> Extent3d
pub fn mip_level_size(&self, level: u32, dim: TextureDimension) -> Extent3d
Calculates the extent at a given mip level. Does not account for memory size being a multiple of block size.
https://gpuweb.github.io/gpuweb/#logical-miplevel-specific-texture-extent
Trait Implementations§
source§impl PartialEq for Extent3d
impl PartialEq for Extent3d
impl Copy for Extent3d
impl Eq for Extent3d
impl StructuralPartialEq for Extent3d
Auto Trait Implementations§
impl Freeze for Extent3d
impl RefUnwindSafe for Extent3d
impl Send for Extent3d
impl Sync for Extent3d
impl Unpin for Extent3d
impl UnwindSafe for Extent3d
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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
.