Struct SemaphoreList

Source
pub struct SemaphoreList {
    mode: SemaphoreListMode,
    semaphores: Vec<Semaphore>,
    values: Vec<u64>,
    pub stage_masks: Vec<PipelineStageFlags>,
}
Expand description

A list of Vulkan semaphores to wait for or signal.

This represents a list of binary or timeline semaphores, together with values for the timeline semaphores, and stage masks, if these are used for waiting.

This type ensures that the array of semaphores to be signaled stays aligned with the array of values for timeline semaphores appearing in that list. The add_to_submit method prepares the vkQueueSubmit arguments appropriately for whatever semaphores we actually have.

Fields§

§mode: SemaphoreListMode

Mode of the semaphore list. Used for validation.

§semaphores: Vec<Semaphore>

Semaphores to use.

This can be a mix of binary and timeline semaphores.

§values: Vec<u64>

Values for the timeline semaphores.

If no timeline semaphores are present in semaphores, this is empty. If any timeline semaphores are present, then this has the same length as semaphores, with dummy !0 values in the elements corresponding to binary semaphores, since Vulkan ignores these.

§stage_masks: Vec<PipelineStageFlags>

Stage masks for wait semaphores.

This is only used if mode is Wait.

Implementations§

Source§

impl SemaphoreList

Source

pub fn new(mode: SemaphoreListMode) -> Self

Source

pub fn is_empty(&self) -> bool

Source

pub fn add_to_submit<'info, 'semaphores: 'info>( wait_semaphores: &'semaphores mut Self, signal_semaphores: &'semaphores mut Self, submit_info: SubmitInfo<'info>, timeline_info: &'info mut MaybeUninit<TimelineSemaphoreSubmitInfo<'info>>, ) -> SubmitInfo<'info>

Add this list to the semaphores to be signalled by a vkQueueSubmit call.

  • Set submit_info’s pSignalSemaphores list to this list’s semaphores.

  • If this list contains any timeline semaphores, then initialize timeline_info, set its pSignalSemaphoreValues to this list’s values, and add it to submit_infos extension chain.

Return the revised submit_info value.

Source

pub fn push_signal(&mut self, semaphore: SemaphoreType)

Add a semaphore to be signaled. Panics if this is a list of semaphores to wait.

Source

pub fn push_wait(&mut self, semaphore: SemaphoreType, stage: PipelineStageFlags)

Add a semaphore to be waited for. Panics if this is a list of semaphores to signal.

Source

fn push_inner(&mut self, semaphore: SemaphoreType)

Source

pub fn append(&mut self, other: &mut Self)

Append other to self, leaving other empty.

Source

fn pad_values(&mut self)

Pad self.values with dummy values for binary semaphores, in preparation for adding a timeline semaphore value.

This is a no-op if we already have values.

Source

fn check(&self)

Trait Implementations§

Source§

impl Debug for SemaphoreList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,