Skip to content

Commit 4bf8427

Browse files
Marc PabstWumpf
authored andcommitted
add lifetime comment
1 parent e827cc6 commit 4bf8427

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

wgpu-hal/src/dx12/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ pub struct Instance {
462462
supports_allow_tearing: bool,
463463
_lib_dxgi: DxgiLib,
464464
flags: wgt::InstanceFlags,
465-
options: wgt::Dx12BackendOptions,
466465
memory_budget_thresholds: wgt::MemoryBudgetThresholds,
467466
compiler_container: Arc<shader_compilation::CompilerContainer>,
467+
options: wgt::Dx12BackendOptions,
468468
}
469469

470470
impl Instance {
@@ -537,6 +537,15 @@ struct SwapChain {
537537
present_mode: wgt::PresentMode,
538538
format: wgt::TextureFormat,
539539
size: wgt::Extent3d,
540+
options: wgt::Dx12BackendOptions,
541+
}
542+
543+
impl SwapChain {
544+
/// Returns the waitable handle associated with this swap chain, if any.
545+
/// Handle is only valid while the swap chain is alive.
546+
pub unsafe fn waitable_handle(&self) -> Option<Foundation::HANDLE> {
547+
self.waitable
548+
}
540549
}
541550

542551
enum SurfaceTarget {
@@ -1415,6 +1424,7 @@ impl crate::Surface for Surface {
14151424
present_mode: config.present_mode,
14161425
format: config.format,
14171426
size: config.extent,
1427+
options: device.options.clone(),
14181428
});
14191429

14201430
Ok(())

0 commit comments

Comments
 (0)