wgpu/api/
command_buffer.rs

1use std::sync::Arc;
2
3use parking_lot::Mutex;
4
5use crate::*;
6
7/// Handle to a command buffer on the GPU.
8///
9/// A `CommandBuffer` represents a complete sequence of commands that may be submitted to a command
10/// queue with [`Queue::submit`]. A `CommandBuffer` is obtained by recording a series of commands to
11/// a [`CommandEncoder`] and then calling [`CommandEncoder::finish`].
12///
13/// Corresponds to [WebGPU `GPUCommandBuffer`](https://gpuweb.github.io/gpuweb/#command-buffer).
14#[derive(Debug, Clone)]
15pub struct CommandBuffer {
16    pub(crate) inner: Arc<Mutex<Option<dispatch::DispatchCommandBuffer>>>,
17}
18#[cfg(send_sync)]
19static_assertions::assert_impl_all!(CommandBuffer: Send, Sync);
20
21crate::cmp::impl_eq_ord_hash_arc_address!(CommandBuffer => .inner);