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