Skip to content

Commit 8ea1569

Browse files
refactor(hal): impl. From conversions b/w wgh::CopyExtent and wgt::Extent3d
1 parent 7885006 commit 8ea1569

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

wgpu-hal/src/lib.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,36 @@ pub struct CopyExtent {
23152315
pub depth: u32,
23162316
}
23172317

2318+
impl From<wgt::Extent3d> for CopyExtent {
2319+
fn from(value: wgt::Extent3d) -> Self {
2320+
let wgt::Extent3d {
2321+
width,
2322+
height,
2323+
depth_or_array_layers,
2324+
} = value;
2325+
Self {
2326+
width,
2327+
height,
2328+
depth: depth_or_array_layers,
2329+
}
2330+
}
2331+
}
2332+
2333+
impl From<CopyExtent> for wgt::Extent3d {
2334+
fn from(value: CopyExtent) -> Self {
2335+
let CopyExtent {
2336+
width,
2337+
height,
2338+
depth,
2339+
} = value;
2340+
Self {
2341+
width,
2342+
height,
2343+
depth_or_array_layers: depth,
2344+
}
2345+
}
2346+
}
2347+
23182348
#[derive(Clone, Debug)]
23192349
pub struct TextureCopy {
23202350
pub src_base: TextureCopyBase,

0 commit comments

Comments
 (0)