Struct CommandBuffer
pub struct CommandBuffer { /* private fields */ }
unstable-wgpu-24
only.Expand description
A buffer of commands to be submitted to the GPU for execution.
Whereas the WebGPU API uses two separate types for command buffers and encoders, this type is a fusion of the two:
-
During command recording, this holds a [
CommandEncoder
] accepting this buffer’s commands. In this state, theCommandBuffer
type behaves like a WebGPUGPUCommandEncoder
. -
Once command recording is finished by calling
Global::command_encoder_finish
, no further recording is allowed. The internal [CommandEncoder
] is retained solely as a storage pool for the raw command buffers. In this state, the value behaves like a WebGPUGPUCommandBuffer
. -
Once a command buffer is submitted to the queue, it is removed from the id registry, and its contents are taken to construct a [
BakedCommands
], whose contents eventually become the property of the submission queue.
Implementations§
§impl CommandBuffer
impl CommandBuffer
pub fn take_finished<'a>( &'a self, ) -> Result<CommandBufferMutable, InvalidResourceError>
Trait Implementations§
§impl Labeled for CommandBuffer
impl Labeled for CommandBuffer
§fn label(&self) -> &str
fn label(&self) -> &str
fn error_ident(&self) -> ResourceErrorIdent
§impl ParentDevice for CommandBuffer
impl ParentDevice for CommandBuffer
fn device(&self) -> &Arc<Device>
fn is_equal(self: &Arc<Self>, other: &Arc<Self>) -> bool
fn same_device_as<O>(&self, other: &O) -> Result<(), DeviceError>where
O: ParentDevice,
fn same_device(&self, device: &Device) -> Result<(), DeviceError>
§impl ResourceType for CommandBuffer
impl ResourceType for CommandBuffer
Auto Trait Implementations§
impl !Freeze for CommandBuffer
impl !RefUnwindSafe for CommandBuffer
impl Send for CommandBuffer
impl Sync for CommandBuffer
impl Unpin for CommandBuffer
impl !UnwindSafe for CommandBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more