add methods to get raw d3d12::ComPtr<dxgi1_4::IDXGISwapChain3>

This commit is contained in:
Marc Pabst 2024-06-03 17:13:28 +01:00
parent 7954a6bd3e
commit 49101f2057

View File

@ -177,6 +177,12 @@ pub struct Surface {
unsafe impl Send for Surface {}
unsafe impl Sync for Surface {}
impl Surface {
pub unsafe fn swap_chain(&self) -> Option<d3d12::ComPtr<dxgi1_4::IDXGISwapChain3>> {
self.swap_chain.read().as_ref().map(|sc| sc.raw())
}
}
#[derive(Debug, Clone, Copy)]
enum MemoryArchitecture {
Unified {
@ -621,6 +627,10 @@ impl SwapChain {
self.raw
}
unsafe fn raw(&self) -> d3d12::ComPtr<dxgi1_4::IDXGISwapChain3> {
self.raw.clone()
}
unsafe fn wait(
&mut self,
timeout: Option<std::time::Duration>,