pub struct Fence { /* private fields */ }
Expand description
A fence is used to know when a command buffer submission has finished its execution.
When a command buffer accesses a resource, you have to ensure that the CPU doesn’t access the same resource simultaneously (except for concurrent reads). Therefore in order to know when the CPU can access a resource again, a fence has to be used.
Implementations
sourceimpl Fence
impl Fence
sourcepub fn new(
device: Arc<Device>,
create_info: FenceCreateInfo
) -> Result<Fence, OomError>
pub fn new(
device: Arc<Device>,
create_info: FenceCreateInfo
) -> Result<Fence, OomError>
Creates a new Fence
.
sourcepub fn from_pool(device: Arc<Device>) -> Result<Fence, OomError>
pub fn from_pool(device: Arc<Device>) -> Result<Fence, OomError>
Takes a fence from the vulkano-provided fence pool.
If the pool is empty, a new fence will be created.
Upon drop
, the fence is put back into the pool.
For most applications, using the fence pool should be preferred, in order to avoid creating new fences every frame.
sourcepub fn is_signaled(&self) -> Result<bool, OomError>
pub fn is_signaled(&self) -> Result<bool, OomError>
Returns true if the fence is signaled.
sourcepub fn wait(&self, timeout: Option<Duration>) -> Result<(), FenceWaitError>
pub 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.
sourcepub fn multi_wait<'a, I>(
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence>,
pub fn multi_wait<'a, I>(
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence>,
sourcepub fn multi_reset<'a, I>(iter: I) -> Result<(), OomError> where
I: IntoIterator<Item = &'a mut Fence>,
pub fn multi_reset<'a, I>(iter: I) -> Result<(), OomError> where
I: IntoIterator<Item = &'a mut Fence>,
Trait Implementations
sourceimpl DeviceOwned for Fence
impl DeviceOwned for Fence
sourceimpl VulkanObject for Fence
impl VulkanObject for Fence
sourcefn internal_object(&self) -> Fence
fn internal_object(&self) -> Fence
Returns a reference to the object.
impl Eq for Fence
Auto Trait Implementations
impl RefUnwindSafe for Fence
impl Send for Fence
impl Sync for Fence
impl Unpin for Fence
impl UnwindSafe for Fence
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more