mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
refactor(hal): impl. From conversions b/w wgh::CopyExtent and wgt::Extent3d
This commit is contained in:
1 parent
66e90619b2
commit
c4a19ab4a8
1 file changed
+30
@@ -2340,6 +2340,36 @@ pub struct CopyExtent {
|
||||
pub depth: u32,
|
||||
}
|
||||
|
||||
impl From<wgt::Extent3d> for CopyExtent {
|
||||
fn from(value: wgt::Extent3d) -> Self {
|
||||
let wgt::Extent3d {
|
||||
width,
|
||||
height,
|
||||
depth_or_array_layers,
|
||||
} = value;
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
depth: depth_or_array_layers,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CopyExtent> for wgt::Extent3d {
|
||||
fn from(value: CopyExtent) -> Self {
|
||||
let CopyExtent {
|
||||
width,
|
||||
height,
|
||||
depth,
|
||||
} = value;
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
depth_or_array_layers: depth,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TextureCopy {
|
||||
pub src_base: TextureCopyBase,
|
||||
|
||||
Reference in new issue
Block a user