Struct vulkano::sync::Fence [−][src]
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]
impl<D> Fence<D> where
D: SafeDeref<Target = Device>,
pub fn from_pool(device: D) -> Result<Fence<D>, OomError>
[src]
pub fn from_pool(device: D) -> Result<Fence<D>, OomError>
Takes a fence from the vulkano-provided fence pool.
If the pool is empty, a new fence will be allocated.
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.
pub fn alloc(device: D) -> Result<Fence<D>, OomError>
[src]
pub fn alloc(device: D) -> Result<Fence<D>, OomError>
Builds a new fence.
pub fn alloc_signaled(device: D) -> Result<Fence<D>, OomError>
[src]
pub fn alloc_signaled(device: D) -> Result<Fence<D>, OomError>
Builds a new fence in signaled state.
pub fn ready(&self) -> Result<bool, OomError>
[src]
pub fn ready(&self) -> Result<bool, OomError>
Returns true if the fence is signaled.
pub fn wait(&self, timeout: Option<Duration>) -> Result<(), FenceWaitError>
[src]
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.
pub fn multi_wait<'a, I>(
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence<D>>,
D: 'a,
[src]
pub fn multi_wait<'a, I>(
iter: I,
timeout: Option<Duration>
) -> Result<(), FenceWaitError> where
I: IntoIterator<Item = &'a Fence<D>>,
D: 'a,
pub fn reset(&mut self) -> Result<(), OomError>
[src]
pub fn reset(&mut self) -> Result<(), OomError>
Resets the fence.
pub fn multi_reset<'a, I>(iter: I) -> Result<(), OomError> where
I: IntoIterator<Item = &'a mut Fence<D>>,
D: 'a,
[src]
pub fn multi_reset<'a, I>(iter: I) -> Result<(), OomError> where
I: IntoIterator<Item = &'a mut Fence<D>>,
D: 'a,
Trait Implementations
impl<D: Debug> Debug for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
impl<D: Debug> Debug for Fence<D> where
D: SafeDeref<Target = Device>,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl DeviceOwned for Fence
[src]
impl DeviceOwned for Fence
impl<D> VulkanObject for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
impl<D> VulkanObject for Fence<D> where
D: SafeDeref<Target = Device>,
type Object = Fence
The type of the object.
const TYPE: DebugReportObjectTypeEXT
TYPE: DebugReportObjectTypeEXT = vk::DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT
The DebugReportObjectTypeEXT
of the internal Vulkan handle.
fn internal_object(&self) -> Fence
[src]
fn internal_object(&self) -> Fence
Returns a reference to the object.
impl<D> Drop for Fence<D> where
D: SafeDeref<Target = Device>,
[src]
impl<D> Drop for Fence<D> where
D: SafeDeref<Target = Device>,