[−][src]Struct nobs_vulkanism_headless::cmd::BatchSubmit
Collection of streams that are submitted to the same queue.
Queue submit calles should subit as many command buffers as possible batched together, because it is a very overhead heavy operation. BatchSubmit collects Streams that can be batched together and submits them in a single call.
Submitting the batch will yield a BatchWait to synchronize with the CPU. Syncing with the CPU will yield a BatchSubmit again. This is implemented in a way that the internal vectors holding the streams does not need to be freed/allocated again.
See AutoBatch, where this ping-pong behavior is implemented in a single type.
Methods
impl BatchSubmit
[src]
pub fn new(device: Device) -> Result<Self, Error>
[src]
Creates a new batch with capacity = 1
pub fn with_capacity(device: Device, capacity: usize) -> Result<Self, Error>
[src]
Creates a new batch
Initalizes vectors to hold the streams with capacity
.
This might be useful if we know the maximum number of stream that are submited to the batch up front, because we do not need to resize and reallocate vectors as much.
For the same reason we should e.g. not create a new batch every frame but use an AutoBatch or Frame that lives outside of the render loop. Otherwise we would free the memory for the cached streams after every loop and reallocate them in the next frame again.
pub fn wait_for(self, sig: Semaphore, stage: ShaderStageFlags) -> Self
[src]
Waits for sig
in stage
Adds the semaphore to the waiting signals. Can be called multiple times, the execution will then wait on all submitted semaphores.
pub fn push(self, stream: Stream) -> Self
[src]
Adds a stream to the batch
After this, the stream can not be modified any more.
Pushing a stream into the batch will automatically call vk::EndCommandBuffer
on the streams command buffer.
pub fn submit(self, queue: Queue) -> (BatchWait, Semaphore)
[src]
Submit all streams to the queue.
Returns
A tuple with
- the BatchWait used for syncronisation
- the semaphore that indicates when the batch is done with its execution
pub fn submit_immediate(self, queue: Queue) -> Result<BatchSubmit, Error>
[src]
Submits all streams to the queue and syncs with the CPU
pub fn clear(self) -> Self
[src]
Auto Trait Implementations
impl Send for BatchSubmit
impl Sync for BatchSubmit
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,