diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 660601d41a..5294a16275 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -283,6 +283,10 @@ impl super::Device { result } + pub fn raw_device(&self) -> &native::Device { + &self.raw + } + pub unsafe fn texture_from_raw( resource: native::Resource, format: wgt::TextureFormat, diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index 0d58864287..5af777e595 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -677,6 +677,10 @@ impl super::Device { }, }) } + + pub fn raw_device(&self) -> &ash::Device { + &self.shared.raw + } } impl crate::Device for super::Device {