pub struct Semaphore { /* private fields */ }
Expand description
Similar to a GL sync object, this describes a semaphore which can be used for OpenGL-Vulkan command queue synchronization.
Implementations§
source§impl Semaphore
impl Semaphore
sourcepub unsafe fn new_from_fd<F: Facade + ?Sized>(
facade: &F,
fd: File
) -> Result<Self, SemaphoreCreationError>
pub unsafe fn new_from_fd<F: Facade + ?Sized>( facade: &F, fd: File ) -> Result<Self, SemaphoreCreationError>
Creates a semaphore imported from an opaque file descriptor.
sourcepub fn wait_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)
pub fn wait_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)
Same as wait
but without buffers
parameter
sourcepub fn wait<T>(
&self,
textures: Option<&[(&TextureAny, TextureLayout)]>,
buffers: Option<&[&Buffer<T>]>
)where
T: Content + ?Sized,
pub fn wait<T>( &self, textures: Option<&[(&TextureAny, TextureLayout)]>, buffers: Option<&[&Buffer<T>]> )where T: Content + ?Sized,
The semaphore blocks the GPU’s command queue until the semaphore is signalled. This does not block the CPU.
After this completes, the semaphore is returned to the unsignalled state.
Once the operation is complete, the memory corresponding to the passed textures
and buffers
is made available to OpenGL.
The layouts given with each texture must match the image layout used in Vulkan directly before the semaphore is signalled by it.
Caution
- You must make sure that a command to signal the semaphore you are waiting on has been flushed to the command queue (Possibly by the external API). Failure to do so may result in segfaults depending on the driver used.
sourcepub fn signal_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)
pub fn signal_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)
Same as signal
, but without buffers parameter
sourcepub fn signal<T>(
&self,
textures: Option<&[(&TextureAny, TextureLayout)]>,
buffers: Option<&[&Buffer<T>]>
)where
T: Content + ?Sized,
pub fn signal<T>( &self, textures: Option<&[(&TextureAny, TextureLayout)]>, buffers: Option<&[&Buffer<T>]> )where T: Content + ?Sized,
Sends signal through semaphore.
The memory of the textures
and buffers
is made available to the external API.
Before signalling the semaphore, the textures
are transitioned into the layout specified.