pub struct Fence<B: Backend> { /* private fields */ }
Expand description
Fence wrapper.
Implementations§
Source§impl<B> Fence<B>where
B: Backend,
impl<B> Fence<B>where
B: Backend,
Sourcepub fn assert_device_owner(&self, device: &Device<B>)
pub fn assert_device_owner(&self, device: &Device<B>)
Assert specified device is owner.
Sourcepub fn instance_id(&self) -> InstanceId
pub fn instance_id(&self) -> InstanceId
Get owned id.
Sourcepub fn assert_instance_owner(&self, instance: &Instance<B>)
pub fn assert_instance_owner(&self, instance: &Instance<B>)
Assert specified instance is owner.
Source§impl<B> Fence<B>where
B: Backend,
impl<B> Fence<B>where
B: Backend,
Sourcepub fn new(device: &Device<B>, signaled: bool) -> Result<Self, OutOfMemory>
pub fn new(device: &Device<B>, signaled: bool) -> Result<Self, OutOfMemory>
Create new fence in signaled or unsignaled state.
Sourcepub fn is_submitted(&self) -> bool
pub fn is_submitted(&self) -> bool
Check if fence was submitted.
Sourcepub fn is_signaled(&self) -> bool
pub fn is_signaled(&self) -> bool
Check if fence is signaled.
Sourcepub fn is_unsignaled(&self) -> bool
pub fn is_unsignaled(&self) -> bool
Check if fence is unsignaled. It can be submitted as well.
Sourcepub fn reset(&mut self, device: &Device<B>) -> Result<(), OutOfMemory>
pub fn reset(&mut self, device: &Device<B>) -> Result<(), OutOfMemory>
Reset signaled fence. Panics if not signaled. Becomes unsigneled.
Sourcepub unsafe fn mark_reset(&mut self)
pub unsafe fn mark_reset(&mut self)
Mark signaled fence as reset. Panics if not signaled. Becomes unsigneled. Fence must be reset using raw fence value.
Sourcepub unsafe fn mark_signaled(&mut self) -> FenceEpoch
pub unsafe fn mark_signaled(&mut self) -> FenceEpoch
Mark fence as signaled. Panics if not submitted. Fence must be checked to be signaled using raw fence value.
Sourcepub fn wait_signaled(
&mut self,
device: &Device<B>,
timeout_ns: u64,
) -> Result<Option<FenceEpoch>, OomOrDeviceLost>
pub fn wait_signaled( &mut self, device: &Device<B>, timeout_ns: u64, ) -> Result<Option<FenceEpoch>, OomOrDeviceLost>
Wait for fence to become signaled. Panics if not submitted. Returns submission epoch on success.
Sourcepub fn check_signaled(
&mut self,
device: &Device<B>,
) -> Result<Option<FenceEpoch>, DeviceLost>
pub fn check_signaled( &mut self, device: &Device<B>, ) -> Result<Option<FenceEpoch>, DeviceLost>
Check if fence has became signaled. Panics if not submitted. Returns submission epoch on success.
Sourcepub fn raw(&self) -> &B::Fence
pub fn raw(&self) -> &B::Fence
Get raw fence reference.
Use mark_*
functions to reflect stage changes.
Sourcepub fn epoch(&self) -> FenceEpoch
pub fn epoch(&self) -> FenceEpoch
Get submission epoch. Panics if not submitted.
Sourcepub fn into_inner(self) -> B::Fence
pub fn into_inner(self) -> B::Fence
Unwrap raw fence value. Panics if submitted.