From b89a57f8ca9d8f93ef7995c8003152240fdbbe12 Mon Sep 17 00:00:00 2001 From: Adam Winiarczuk Date: Fri, 8 Nov 2024 18:54:10 +0100 Subject: [PATCH] Dx12 HAL texture: expose raw resource (#6502) Co-authored-by: Adam Winiarczuk --- wgpu-hal/src/dx12/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index 92c009b9c3..bc9f0db156 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -777,6 +777,12 @@ pub struct Texture { allocation: Option, } +impl Texture { + pub unsafe fn raw_resource(&self) -> &Direct3D12::ID3D12Resource { + &self.resource + } +} + impl crate::DynTexture for Texture {} impl crate::DynSurfaceTexture for Texture {}