#[derive(Clone, Copy, Debug, Default, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct Dimension {
pub width: u32,
pub height: u32,
}
impl Dimension {
#[inline]
pub const fn new(width: u32, height: u32) -> Self {
Self { width, height }
}
pub const fn to_extent_3d(&self) -> wgpu::Extent3d {
wgpu::Extent3d {
width: self.width,
height: self.height,
depth_or_array_layers: 1,
}
}
#[inline]
pub const fn area(&self) -> u32 {
self.width * self.height
}
}