Struct glium::semaphore::Semaphore

source ·
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

source

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.

source

pub fn wait_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)

Same as wait but without buffers parameter

source

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.
source

pub fn signal_textures(&self, textures: Option<&[(&TextureAny, TextureLayout)]>)

Same as signal, but without buffers parameter

source

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.

Trait Implementations§

source§

impl Drop for Semaphore

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl GlObject for Semaphore

§

type Id = u32

The type of identifier for this object.
source§

fn get_id(&self) -> c_uint

Returns the id of the object.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.