#[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§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.