Struct vulkano::sync::Fence
[−]
[src]
pub struct Fence<D = Arc<Device>> where
D: SafeDeref<Target = Device>, { /* fields omitted */ }
A fence is used to know when a command buffer submission has finished its execution.
When a command buffer accesses a ressource, you have to ensure that the CPU doesn't access the same ressource simultaneously (except for concurrent reads). Therefore in order to know when the CPU can access a ressource again, a fence has to be used.
Methods
impl<D> Fence<D> where
D: SafeDeref<Target = Device>,
[src]
D: SafeDeref<Target = Device>,
fn new(device: D) -> Result<Fence<D>, OomError>
Builds a new fence.
fn signaled(device: D) -> Result<Fence<D>, OomError>
See the docs of signaled().
fn ready(&self) -> Result<bool, OomError>
Returns true if the fence is signaled.
fn wait(&self, timeout: Option<Duration>) -> Result<(), FenceWaitError>
Waits until the fence is signaled, or at least until the timeout duration has elapsed.
Returns Ok
if the fence is now signaled. Returns Err
if the timeout was reached instead.
If you pass a duration of 0, then the function will return without blocking.
fn multi_wait<'a, I>(
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence<D>>,
D: 'a,
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence<D>>,
D: 'a,
fn reset(&mut self)
Resets the fence.
fn multi_reset<'a, I>(iter: I) where
I: IntoIterator<Item = &'a mut Fence<D>>,
D: 'a,
I: IntoIterator<Item = &'a mut Fence<D>>,
D: 'a,
Trait Implementations
impl<D: Debug> Debug for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
D: SafeDeref<Target = Device>,
impl DeviceOwned for Fence
[src]
impl<D> VulkanObject for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
D: SafeDeref<Target = Device>,
type Object = Fence
The type of the object.
fn internal_object(&self) -> Fence
Returns a reference to the object.
impl<D> Drop for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
D: SafeDeref<Target = Device>,