Struct wgpu_types::Extent3d
source · [−]Expand description
Extent of a texture related operation.
Corresponds to WebGPU GPUExtent3D
.
Fields
width: u32
height: u32
depth_or_array_layers: u32
Implementations
sourceimpl Extent3d
impl Extent3d
sourcepub fn physical_size(&self, format: TextureFormat) -> Self
pub fn physical_size(&self, format: TextureFormat) -> Self
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, is_3d_texture: bool) -> Extent3d
pub fn mip_level_size(&self, level: u32, is_3d_texture: bool) -> Extent3d
Calculates the extent at a given mip level. Does not account for memory size being a multiple of block size.
Trait Implementations
impl Copy for Extent3d
impl Eq for Extent3d
impl StructuralEq for Extent3d
impl StructuralPartialEq for Extent3d
Auto Trait Implementations
impl RefUnwindSafe for Extent3d
impl Send for Extent3d
impl Sync for Extent3d
impl Unpin for Extent3d
impl UnwindSafe for Extent3d
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more