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: SemaphoreListModeMode 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
impl SemaphoreList
pub fn new(mode: SemaphoreListMode) -> Self
pub fn is_empty(&self) -> bool
Sourcepub 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>
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’spSignalSemaphoreslist to this list’s semaphores. -
If this list contains any timeline semaphores, then initialize
timeline_info, set itspSignalSemaphoreValuesto this list’s values, and add it tosubmit_infos extension chain.
Return the revised submit_info value.
Sourcepub fn push_signal(&mut self, semaphore: SemaphoreType)
pub fn push_signal(&mut self, semaphore: SemaphoreType)
Add a semaphore to be signaled. Panics if this is a list of semaphores to wait.
Sourcepub fn push_wait(&mut self, semaphore: SemaphoreType, stage: PipelineStageFlags)
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.
fn push_inner(&mut self, semaphore: SemaphoreType)
Sourcefn pad_values(&mut self)
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.