1mod buffer;
23mod buffer_descriptor;
24mod compute_command;
25mod render_command;
26
27pub use buffer::IndirectCommandBuffer;
28pub use buffer_descriptor::IndirectCommandBufferDescriptor;
29pub use compute_command::IndirectComputeCommand;
30pub use render_command::IndirectRenderCommand;
31
32#[repr(C, packed)]
40#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
41pub struct IndirectCommandBufferExecutionRange {
42 pub location: u32,
44 pub length: u32,
46}
47
48impl IndirectCommandBufferExecutionRange {
49 #[inline]
51 pub const fn new(location: u32, length: u32) -> Self {
52 Self { location, length }
53 }
54}
55
56#[cfg(test)]
57mod tests {
58 use super::*;
59 use std::ffi::c_void;
60
61 #[test]
62 fn test_indirect_command_buffer_execution_range_size() {
63 assert_eq!(
64 std::mem::size_of::<IndirectCommandBufferExecutionRange>(),
65 8
66 );
67 }
68
69 #[test]
70 fn test_indirect_command_buffer_descriptor_size() {
71 assert_eq!(
72 std::mem::size_of::<IndirectCommandBufferDescriptor>(),
73 std::mem::size_of::<*mut c_void>()
74 );
75 }
76
77 #[test]
78 fn test_indirect_command_buffer_size() {
79 assert_eq!(
80 std::mem::size_of::<IndirectCommandBuffer>(),
81 std::mem::size_of::<*mut c_void>()
82 );
83 }
84
85 #[test]
86 fn test_indirect_render_command_size() {
87 assert_eq!(
88 std::mem::size_of::<IndirectRenderCommand>(),
89 std::mem::size_of::<*mut c_void>()
90 );
91 }
92
93 #[test]
94 fn test_indirect_compute_command_size() {
95 assert_eq!(
96 std::mem::size_of::<IndirectComputeCommand>(),
97 std::mem::size_of::<*mut c_void>()
98 );
99 }
100}