From 208fe4c23d0bd7a13bbb653f4fa221f475ba76c2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 26 Jun 2025 22:34:59 +0200 Subject: [PATCH] Expose the DxgiAdapter in the Hal adapter (#7852) --- CHANGELOG.md | 1 + wgpu-hal/src/dx12/mod.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed83558f8..62c4fe68d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,7 @@ Bottom level categories: #### DX12 - Get `vertex_index` & `instance_index` builtins working for indirect draws. By @teoxoy in [#7535](https://github.com/gfx-rs/wgpu/pull/7535) +- Added `wgpu_hal::dx12::Adapter::as_raw()`. By @tronical in [##7852](https://github.com/gfx-rs/wgpu/pull/7852) #### Vulkan diff --git a/wgpu-hal/src/dx12/mod.rs b/wgpu-hal/src/dx12/mod.rs index c8695e2f0..c8e6c3e0c 100644 --- a/wgpu-hal/src/dx12/mod.rs +++ b/wgpu-hal/src/dx12/mod.rs @@ -604,6 +604,12 @@ pub struct Adapter { unsafe impl Send for Adapter {} unsafe impl Sync for Adapter {} +impl Adapter { + pub fn as_raw(&self) -> &Dxgi::IDXGIAdapter3 { + &self.raw + } +} + struct Event(pub Foundation::HANDLE); impl Event { pub fn create(manual_reset: bool, initial_state: bool) -> Result {