[][src]Struct nobs_vulkanism_headless::cmd::AutoBatch

pub struct AutoBatch { /* fields omitted */ }

Convenietly ping pong between BatchSubmit and BatchWait.

Implements the same functions as BatchSubmit and BatchWait, without the need for managing both types. The main difference is, that the AutoBatch is either in a submitting state or a waiting state, which is otherwise handles by the two different types. Doing this with two types has the benefit, that the compiler prevents us from colling a function that is not defined for the current state. However it can be tedious to manage the two types, hence the AutoBatch.

Note that in the AutoBatch nothing prevents us from calling push directly after submit, which is usually not defined, because the batch was already in a waiting state. In general all functions behave exactly as in BatchSubmit and BatchWait as long as they are called in their respective state, otherwise they become NOPs.

If the batch is submitting, we can call

and all other methods will become NOPs. If the batch is waiting, we can call

and all other methods will become NOPs.

Methods

impl AutoBatch[src]

pub fn new(device: Device) -> Result<Self, Error>[src]

Create a new batch with capacity = 1

pub fn with_capacity(device: Device, capacity: usize) -> Result<Self, Error>[src]

Create a new batch with capacity as in BatchSubmit::with_capacity

pub fn is_submitting(&self) -> bool[src]

Checks if the batch is in submitting state

pub fn is_waiting(&self) -> bool[src]

Checks if the batch is in waiting state

pub fn wait_for(&mut self, sig: Semaphore, stage: ShaderStageFlags) -> &mut Self[src]

Waits for sig in stage

See (BatchSubmit::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.

pub fn submit_immediate(&mut self, queue: Queue) -> Result<&mut Self, Error>[src]

Submits all streams to the queue and syncs with the CPU

If this batch is in waiting state this function will become a NOP.

pub fn sync(&mut self) -> Result<&mut Self, Error>[src]

Returns all stream to the pool with waive and clears all wait signals

See BatchWait::sync.

If this batch is in submitting state this function will become a NOP.

Auto Trait Implementations

impl Send for AutoBatch

impl Sync for AutoBatch

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.