pub struct CommandBuffer {
pub(crate) device: Arc<Device>,
support_clear_texture: bool,
label: String,
pub(crate) data: Mutex<CommandEncoderStatus>,
}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
CommandEncoderaccepting this buffer’s commands. In this state, theCommandBuffertype behaves like a WebGPUGPUCommandEncoder. -
Once command recording is finished by calling
Global::command_encoder_finish, no further recording is allowed. The internalCommandEncoderis 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.
Fields§
§device: Arc<Device>§support_clear_texture: bool§label: StringThe label from the descriptor used to create the resource.
data: Mutex<CommandEncoderStatus>The mutable state of this command buffer.