wgpu_core/command/
compute_command.rs

1#[cfg(feature = "serde")]
2use crate::command::serde_object_reference_struct;
3use crate::command::{ArcReferences, ReferenceType};
4
5#[cfg(feature = "serde")]
6use macro_rules_attribute::apply;
7
8/// cbindgen:ignore
9#[derive(Clone, Debug)]
10#[cfg_attr(feature = "serde", apply(serde_object_reference_struct))]
11pub enum ComputeCommand<R: ReferenceType> {
12    SetBindGroup {
13        index: u32,
14        num_dynamic_offsets: usize,
15        bind_group: Option<R::BindGroup>,
16    },
17
18    SetPipeline(R::ComputePipeline),
19
20    /// Set a range of push constants to values stored in `push_constant_data`.
21    SetPushConstant {
22        /// The byte offset within the push constant storage to write to. This
23        /// must be a multiple of four.
24        offset: u32,
25
26        /// The number of bytes to write. This must be a multiple of four.
27        size_bytes: u32,
28
29        /// Index in `push_constant_data` of the start of the data
30        /// to be written.
31        ///
32        /// Note: this is not a byte offset like `offset`. Rather, it is the
33        /// index of the first `u32` element in `push_constant_data` to read.
34        values_offset: u32,
35    },
36
37    Dispatch([u32; 3]),
38
39    DispatchIndirect {
40        buffer: R::Buffer,
41        offset: wgt::BufferAddress,
42    },
43
44    PushDebugGroup {
45        color: u32,
46        len: usize,
47    },
48
49    PopDebugGroup,
50
51    InsertDebugMarker {
52        color: u32,
53        len: usize,
54    },
55
56    WriteTimestamp {
57        query_set: R::QuerySet,
58        query_index: u32,
59    },
60
61    BeginPipelineStatisticsQuery {
62        query_set: R::QuerySet,
63        query_index: u32,
64    },
65
66    EndPipelineStatisticsQuery,
67}
68
69/// cbindgen:ignore
70pub type ArcComputeCommand = ComputeCommand<ArcReferences>;