diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index 48fcbee6e..3099e7614 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -546,6 +546,12 @@ pub struct Surface { unsafe impl Send for Surface {} unsafe impl Sync for Surface {} +impl Surface { + pub fn swap_chain(&self) -> Option { + Some(self.swap_chain.read().as_ref()?.raw.clone()) + } +} + #[derive(Debug, Clone, Copy)] enum MemoryArchitecture { Unified {