[−][src]Struct nobs_vulkanism_headless::cmd::Frame
Convinietly schedule AutoBatches in round robin
When rendering we can build a batch in parallel while still executing the batch from one (or more) frames before. Here we schedule batches in round robin with N batches. This means we can build/execute up to N batches in parallel.
We advance the frame with next, which syncs with the batch that has been submitted the longest time ago.
Methods
impl Frame
[src]
pub fn new(device: Device, num_frames: usize) -> Result<Self, Error>
[src]
Creates batches for num_frames
Batches are created with capacity = 1
pub fn with_capacity(
device: Device,
num_frames: usize,
batch_capacity: usize
) -> Result<Self, Error>
[src]
device: Device,
num_frames: usize,
batch_capacity: usize
) -> Result<Self, Error>
Creates batches for num_frames
Batches are created with batch_capacity
BatchSubmit::with_capacity
pub fn next(&mut self) -> Result<usize, Error>
[src]
Advances the frame index and returns it
The returned index is assured to be in [0..num_frames]
.
The index is incremented and moduloed with num_frames
.
Syncs with the next batch that is configured.
pub fn wait_for(&mut self, sig: Semaphore, stage: ShaderStageFlags) -> &mut Self
[src]
Waits for sig
in stage
See (AutoBatch::wait_for)[struct.BatchSubmit.html#method.wait_for].
If this batch is in waiting state this function will become a NOP.
pub fn push(&mut self, stream: Stream) -> &mut Self
[src]
Adds a stream to the batch
See (BatchSubmit::push)[struct.BatchSubmit.html#method.push].
If this batch is in waiting state this function will become a NOP.
pub fn submit(&mut self, queue: Queue) -> (&mut Self, Option<Semaphore>)
[src]
Submit all streams to the queue.
See (BatchSubmit::submit)[struct.BatchSubmit.html#method.submit].
If this batch is in waiting state this function will become a NOP.
Auto Trait Implementations
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>,