pub struct Semaphore { /* private fields */ }
Expand description
Used to provide synchronization between command buffers during their execution.
It is similar to a fence, except that it is purely on the GPU side. The CPU can’t query a semaphore’s status or wait for it to be signaled.
Implementations
sourceimpl Semaphore
impl Semaphore
sourcepub fn new(
device: Arc<Device>,
create_info: SemaphoreCreateInfo
) -> Result<Semaphore, SemaphoreCreationError>
pub fn new(
device: Arc<Device>,
create_info: SemaphoreCreateInfo
) -> Result<Semaphore, SemaphoreCreationError>
Creates a new Semaphore
.
sourcepub fn from_pool(
device: Arc<Device>
) -> Result<Semaphore, SemaphoreCreationError>
pub fn from_pool(
device: Arc<Device>
) -> Result<Semaphore, SemaphoreCreationError>
Takes a semaphore from the vulkano-provided semaphore pool.
If the pool is empty, a new semaphore will be allocated.
Upon drop
, the semaphore is put back into the pool.
For most applications, using the pool should be preferred, in order to avoid creating new semaphores every frame.
sourcepub unsafe fn export_opaque_fd(&self) -> Result<File, SemaphoreExportError>
pub unsafe fn export_opaque_fd(&self) -> Result<File, SemaphoreExportError>
Safety
- The semaphore must not be used, or have been used, to acquire a swapchain image.
Trait Implementations
sourceimpl DeviceOwned for Semaphore
impl DeviceOwned for Semaphore
sourceimpl VulkanObject for Semaphore
impl VulkanObject for Semaphore
sourcefn internal_object(&self) -> Semaphore
fn internal_object(&self) -> Semaphore
Returns a reference to the object.
impl Eq for Semaphore
Auto Trait Implementations
impl RefUnwindSafe for Semaphore
impl Send for Semaphore
impl Sync for Semaphore
impl Unpin for Semaphore
impl UnwindSafe for Semaphore
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