[][src]Struct nobs_vulkanism_headless::cmd::Frame

pub struct Frame { /* fields omitted */ }

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]

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

impl Send for Frame

impl Sync for Frame

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.