diff --git a/wgpu-hal/src/dynamic/device.rs b/wgpu-hal/src/dynamic/device.rs index c2dd42ac7..2ede8a42a 100644 --- a/wgpu-hal/src/dynamic/device.rs +++ b/wgpu-hal/src/dynamic/device.rs @@ -127,6 +127,18 @@ pub trait DynDevice: DynResource { unsafe fn create_fence(&self) -> Result, DeviceError>; unsafe fn destroy_fence(&self, fence: Box); unsafe fn get_fence_value(&self, fence: &dyn DynFence) -> Result; + + unsafe fn wait( + &self, + fence: &dyn DynFence, + value: FenceValue, + timeout_ms: u32, + ) -> Result; + + unsafe fn start_capture(&self) -> bool; + unsafe fn stop_capture(&self); + + unsafe fn pipeline_cache_get_data(&self, cache: &dyn DynPipelineCache) -> Option>; } impl DynDevice for D { @@ -417,4 +429,27 @@ impl DynDevice for D { let fence = fence.expect_downcast_ref(); unsafe { D::get_fence_value(self, fence) } } + + unsafe fn wait( + &self, + fence: &dyn DynFence, + value: FenceValue, + timeout_ms: u32, + ) -> Result { + let fence = fence.expect_downcast_ref(); + unsafe { D::wait(self, fence, value, timeout_ms) } + } + + unsafe fn start_capture(&self) -> bool { + unsafe { D::start_capture(self) } + } + + unsafe fn stop_capture(&self) { + unsafe { D::stop_capture(self) } + } + + unsafe fn pipeline_cache_get_data(&self, cache: &dyn DynPipelineCache) -> Option> { + let cache = cache.expect_downcast_ref(); + unsafe { D::pipeline_cache_get_data(self, cache) } + } }