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>
impl<B, C, U, L, R> CommandBuffer<B, C, RecordingState<U>, L, R>
Source§impl<B, C, U, R> CommandBuffer<B, C, RecordingState<U, RenderPassContinue>, SecondaryLevel, R>
impl<B, C, U, R> CommandBuffer<B, C, RecordingState<U, RenderPassContinue>, SecondaryLevel, R>
Sourcepub fn render_pass_encoder(&mut self) -> RenderPassEncoder<'_, B>
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>
impl<B, C, P, L, R> CommandBuffer<B, C, ExecutableState<OneShot, P>, L, R>
Sourcepub fn submit_once(
self,
) -> (Submit<B, NoSimultaneousUse, L, P>, CommandBuffer<B, C, PendingState<InvalidState>, L, R>)
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>
impl<B, C, S, L, P, R> CommandBuffer<B, C, ExecutableState<MultiShot<S>, P>, L, R>
Sourcepub fn submit(
self,
) -> (Submit<B, S, L, P>, CommandBuffer<B, C, PendingState<ExecutableState<MultiShot<S>, P>>, L, R>)
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,
impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>where
B: Backend,
Sourcepub fn assert_family_owner(&self, family: &Family<B, C>)
pub fn assert_family_owner(&self, family: &Family<B, C>)
Assert specified family is owner.
Sourcepub fn assert_device_owner(&self, device: &Device<B>)
pub fn assert_device_owner(&self, device: &Device<B>)
Assert specified device is owner.
Sourcepub fn assert_instance_owner(&self, instance: &Instance<B>)
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,
impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>where
B: Backend,
Sourcepub unsafe fn change_state<U>(
self,
f: impl FnOnce(S) -> U,
) -> CommandBuffer<B, C, U, L, R>
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.
Sourcepub fn capability(&self) -> Cwhere
C: Capability,
pub fn capability(&self) -> Cwhere
C: Capability,
Get buffers capability.
Sourcepub fn with_queue_type(self) -> CommandBuffer<B, QueueType, S, L, R>where
C: Capability,
pub fn with_queue_type(self) -> CommandBuffer<B, QueueType, S, L, R>where
C: Capability,
Convert capability level.
Sourcepub fn with_capability<U>(self) -> Result<CommandBuffer<B, U, S, L, R>, Self>where
C: Supports<U>,
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,
impl<B, C, L, R> CommandBuffer<B, C, InitialState, L, R>where
B: Backend,
Sourcepub 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>,
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,
impl<'a, B, C, U, P, L, R> CommandBuffer<B, C, RecordingState<U, P>, L, R>where
B: Backend,
Sourcepub fn finish(self) -> CommandBuffer<B, C, ExecutableState<U, P>, L, R>
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,
impl<B, C, N, L, R> CommandBuffer<B, C, PendingState<N>, L, R>where
B: Backend,
Sourcepub unsafe fn mark_complete(self) -> CommandBuffer<B, C, N, L, R>
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,
impl<B, C, S, L> CommandBuffer<B, C, S, L, IndividualReset>where
B: Backend,
S: Resettable,
Sourcepub fn reset(self) -> CommandBuffer<B, C, InitialState, L, IndividualReset>
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,
impl<B, C, S, L> CommandBuffer<B, C, S, L>where
B: Backend,
S: Resettable,
Sourcepub unsafe fn mark_reset(self) -> CommandBuffer<B, C, InitialState, L>
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,
impl<B, C, S, L, R> CommandBuffer<B, C, S, L, R>where
B: Backend,
S: Resettable,
Sourcepub fn into_raw(self) -> B::CommandBuffer
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.
Sourcepub fn raw(&mut self) -> &mut B::CommandBuffer
pub fn raw(&mut self) -> &mut B::CommandBuffer
Get raw command buffer handle.