#[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> 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<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.