Skip to main content

wgpu_core/command/
ray_tracing_pass_commands.rs

1#[cfg(feature = "serde")]
2use crate::command::serde_object_reference_struct;
3use crate::command::{ArcReferences, ReferenceType};
4use alloc::vec::Vec;
5
6#[cfg(feature = "serde")]
7use macro_rules_attribute::apply;
8
9/// cbindgen:ignore
10#[derive(Clone, Debug)]
11#[cfg_attr(feature = "serde", apply(serde_object_reference_struct))]
12pub enum RayTracingCommand<R: ReferenceType> {
13    SetBindGroup {
14        index: u32,
15        num_dynamic_offsets: usize,
16        bind_group: Option<R::BindGroup>,
17    },
18
19    SetPipeline(R::RayTracingPipeline),
20
21    /// Set a range of immediates to values stored in `immediates_data`.
22    SetImmediate {
23        /// The byte offset within the immediate data storage to write to.  This
24        /// must be a multiple of four.
25        offset: u32,
26
27        /// The immediate data to be written.
28        data: Vec<u32>,
29    },
30
31    TraceRays([u32; 3]),
32
33    TraceRaysIndirect {
34        buffer: R::Buffer,
35        offset: wgt::BufferAddress,
36    },
37
38    PushDebugGroup {
39        color: u32,
40        len: usize,
41    },
42
43    PopDebugGroup,
44
45    InsertDebugMarker {
46        color: u32,
47        len: usize,
48    },
49}
50
51/// cbindgen:ignore
52pub type ArcRayTracingCommand = RayTracingCommand<ArcReferences>;