rendy_command

Struct CommandBuffer

Source
pub struct CommandBuffer<B: Backend, C, S, L = PrimaryLevel, R = NoIndividualReset> { /* private fields */ }
Expand description

Command buffer wrapper. This wrapper defines state with usage, level and ability to be individually reset at type level. This way many methods become safe.

Implementations§

Source§

impl<B, C, U, L, R> CommandBuffer<B, C, RecordingState<U>, L, R>
where B: Backend, C: Capability, L: Level,

Source

pub fn encoder(&mut self) -> Encoder<'_, B, C, L>

Get encoder that will encode commands into this command buffer.

Source§

impl<B, C, U, R> CommandBuffer<B, C, RecordingState<U, RenderPassContinue>, SecondaryLevel, R>
where B: Backend, C: Supports<Graphics>,

Source

pub fn render_pass_encoder(&mut self) -> RenderPassEncoder<'_, B>

Get encoder that will encode render-pass commands into this command buffer.

Source§

impl<B, C, P, L, R> CommandBuffer<B, C, ExecutableState<OneShot, P>, L, R>
where B: Backend, P: Copy, L: Copy,

Source

pub fn submit_once( self, ) -> (Submit<B, NoSimultaneousUse, L, P>, CommandBuffer<B, C, PendingState<InvalidState>, L, R>)

Produce Submit object that can be used to populate submission.

Source§

impl<B, C, S, L, P, R> CommandBuffer<B, C, ExecutableState<MultiShot<S>, P>, L, R>
where B: Backend, P: Copy, S: Copy, L: Copy,

Source

pub fn submit( self, ) -> (Submit<B, S, L, P>, CommandBuffer<B, C, PendingState<ExecutableState<MultiShot<S>, P>>, L, R>)

Produce Submit object that can be used to populate submission.

Source§

impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>
where B: Backend,

Source

pub fn family_id(&self) -> FamilyId

Get owner id.

Source

pub fn assert_family_owner(&self, family: &Family<B, C>)

Assert specified family is owner.

Source

pub fn assert_device_owner(&self, device: &Device<B>)

Assert specified device is owner.

Source

pub fn assert_instance_owner(&self, instance: &Instance<B>)

Assert specified instance is owner.

Source§

impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>
where B: Backend,

Source

pub unsafe fn change_state<U>( self, f: impl FnOnce(S) -> U, ) -> CommandBuffer<B, C, U, L, R>

Change state of the command buffer.

§Safety
  • This method must be used only to reflect state changed due to raw handle usage.
Source

pub fn capability(&self) -> C
where C: Capability,

Get buffers capability.

Source

pub fn family(&self) -> FamilyId

Get buffers family.

Source

pub fn with_queue_type(self) -> CommandBuffer<B, QueueType, S, L, R>
where C: Capability,

Convert capability level.

Source

pub fn with_capability<U>(self) -> Result<CommandBuffer<B, U, S, L, R>, Self>
where C: Supports<U>,

Convert capability level.

Source§

impl<B, C, L, R> CommandBuffer<B, C, InitialState, L, R>
where B: Backend,

Source

pub fn begin<'a, U, P>( self, usage: U, info: impl BeginInfo<'a, B, L, PassRelation = P>, ) -> CommandBuffer<B, C, RecordingState<U, P>, L, R>
where U: Usage, P: RenderPassRelation<L>,

Begin recording command buffer.

§Parameters

usage - specifies usage of the command buffer. Possible types are OneShot, MultiShot.

Source§

impl<'a, B, C, U, P, L, R> CommandBuffer<B, C, RecordingState<U, P>, L, R>
where B: Backend,

Source

pub fn finish(self) -> CommandBuffer<B, C, ExecutableState<U, P>, L, R>

Finish recording command buffer.

Source§

impl<B, C, N, L, R> CommandBuffer<B, C, PendingState<N>, L, R>
where B: Backend,

Source

pub unsafe fn mark_complete(self) -> CommandBuffer<B, C, N, L, R>

Mark command buffer as complete.

§Safety

None of Submit instances created from this CommandBuffer are alive.

If this is PrimaryLevel buffer then for each command queue where Submit instance (created from this CommandBuffer) was submitted at least one Fence submitted within same Submission or later in unset state was set.

If this is Secondary buffer then all primary command buffers where Submit instance (created from this CommandBuffer) was submitted must be complete.

Source§

impl<B, C, S, L> CommandBuffer<B, C, S, L, IndividualReset>
where B: Backend, S: Resettable,

Source

pub fn reset(self) -> CommandBuffer<B, C, InitialState, L, IndividualReset>

Reset command buffer.

Source§

impl<B, C, S, L> CommandBuffer<B, C, S, L>
where B: Backend, S: Resettable,

Source

pub unsafe fn mark_reset(self) -> CommandBuffer<B, C, InitialState, L>

Mark command buffer as reset.

§Safety
  • This function must be used only to reflect command buffer being reset implicitly. For instance:
  • CommandPool::reset on pool from which the command buffer was allocated.
  • Raw handle usage.
Source§

impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>
where B: Backend, S: Resettable,

Source

pub fn into_raw(self) -> B::CommandBuffer

Dispose of command buffer wrapper releasing raw comman buffer value. This function is intended to be used to deallocate command buffer.

Source

pub fn raw(&mut self) -> &mut B::CommandBuffer

Get raw command buffer handle.

Trait Implementations§

Source§

impl<B: Debug + Backend, C: Debug, S: Debug, L: Debug, R: Debug> Debug for CommandBuffer<B, C, S, L, R>
where B::CommandBuffer: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B, C, S, L, R> Send for CommandBuffer<B, C, S, L, R>
where B: Backend, B::CommandBuffer: Send, C: Send, S: Send, L: Send, R: Send, FamilyId: Send, Relevant: Send,

Source§

impl<B, C, S, L, R> Sync for CommandBuffer<B, C, S, L, R>
where B: Backend, B::CommandBuffer: Sync, C: Sync, S: Sync, L: Sync, R: Sync, FamilyId: Sync, Relevant: Sync,

Auto Trait Implementations§

§

impl<B, C, S, L, R> Freeze for CommandBuffer<B, C, S, L, R>
where C: Freeze, S: Freeze, L: Freeze, R: Freeze,

§

impl<B, C, S, L, R> RefUnwindSafe for CommandBuffer<B, C, S, L, R>

§

impl<B, C, S, L, R> Unpin for CommandBuffer<B, C, S, L, R>
where C: Unpin, S: Unpin, L: Unpin, R: Unpin,

§

impl<B, C, S, L, R> UnwindSafe for CommandBuffer<B, C, S, L, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.