From 10a07e4807930d4bbae043b35394a1f5e2c1cfab Mon Sep 17 00:00:00 2001 From: xiaopengli89 Date: Thu, 6 Jan 2022 21:44:47 +0800 Subject: [PATCH] Add raw_device for dx12, vulkan device --- wgpu-hal/src/dx12/device.rs | 4 ++++ wgpu-hal/src/vulkan/device.rs | 4 ++++ 2 files changed, 8 insertions(+) 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 {