Expose raw_factory (#7827)

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
Mendy Berger 2025-06-25 15:43:23 -04:00 committed by GitHub
parent df272d3cfc
commit 4c08c37a46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,7 @@ Bottom level categories:
#### D3D12 #### D3D12
- Remove the need for dxil.dll. By @teoxoy in [#7566](https://github.com/gfx-rs/wgpu/pull/7566) - Remove the need for dxil.dll. By @teoxoy in [#7566](https://github.com/gfx-rs/wgpu/pull/7566)
- Ability to get the raw `IDXGIFactory4` from `Instance`. By @MendyBerger in [#7827](https://github.com/gfx-rs/wgpu/pull/7827)
#### Vulkan #### Vulkan

View File

@ -465,6 +465,11 @@ pub struct Instance {
} }
impl Instance { impl Instance {
/// Get the raw DXGI factory associated with this instance.
pub unsafe fn raw_factory4(&self) -> &Dxgi::IDXGIFactory4 {
self.factory.deref()
}
pub unsafe fn create_surface_from_visual(&self, visual: *mut ffi::c_void) -> Surface { pub unsafe fn create_surface_from_visual(&self, visual: *mut ffi::c_void) -> Surface {
let visual = unsafe { DirectComposition::IDCompositionVisual::from_raw_borrowed(&visual) } let visual = unsafe { DirectComposition::IDCompositionVisual::from_raw_borrowed(&visual) }
.expect("COM pointer should not be NULL"); .expect("COM pointer should not be NULL");