Skip to content

Commit 6f5a582

Browse files
refactor(hal): impl. From conversions b/w wgh::CopyExtent and wgt::Extent3d
1 parent e09bbc2 commit 6f5a582

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
@@ -2436,6 +2436,36 @@ pub struct CopyExtent {
24362436
pub depth: u32,
24372437
}
24382438

2439+
impl From<wgt::Extent3d> for CopyExtent {
2440+
fn from(value: wgt::Extent3d) -> Self {
2441+
let wgt::Extent3d {
2442+
width,
2443+
height,
2444+
depth_or_array_layers,
2445+
} = value;
2446+
Self {
2447+
width,
2448+
height,
2449+
depth: depth_or_array_layers,
2450+
}
2451+
}
2452+
}
2453+
2454+
impl From<CopyExtent> for wgt::Extent3d {
2455+
fn from(value: CopyExtent) -> Self {
2456+
let CopyExtent {
2457+
width,
2458+
height,
2459+
depth,
2460+
} = value;
2461+
Self {
2462+
width,
2463+
height,
2464+
depth_or_array_layers: depth,
2465+
}
2466+
}
2467+
}
2468+
24392469
#[derive(Clone, Debug)]
24402470
pub struct TextureCopy {
24412471
pub src_base: TextureCopyBase,

0 commit comments

Comments
 (0)