Skip to content

Commit a361e8f

Browse files
committed
indirect command structs: fixed doc lints
1 parent 8d6d3b1 commit a361e8f

File tree

1 file changed

+55
-8
lines changed

1 file changed

+55
-8
lines changed

crates/spirv-std/src/indirect_command.rs

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,58 @@
1+
//! Indirect command structs from vulkan
2+
13
use glam::UVec3;
24

3-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDeviceSize.html>"]
5+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDeviceSize.html>
46
pub type DeviceSize = u64;
5-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDeviceAddress.html>"]
7+
8+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDeviceAddress.html>
69
pub type DeviceAddress = u64;
710

11+
/// Structure specifying an indirect drawing command
12+
///
13+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawIndirectCommand.html>
814
#[repr(C)]
915
#[derive(Copy, Clone, Debug, Default)]
10-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawIndirectCommand.html>"]
1116
pub struct DrawIndirectCommand {
17+
/// vertexCount is the number of vertices to draw.
1218
pub vertex_count: u32,
19+
/// instanceCount is the number of instances to draw.
1320
pub instance_count: u32,
21+
/// firstVertex is the index of the first vertex to draw.
1422
pub first_vertex: u32,
23+
/// firstInstance is the instance ID of the first instance to draw.
1524
pub first_instance: u32,
1625
}
1726

27+
/// Structure specifying an indexed indirect drawing command
28+
///
29+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawIndexedIndirectCommand.html>
1830
#[repr(C)]
1931
#[derive(Copy, Clone, Debug, Default)]
20-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawIndexedIndirectCommand.html>"]
2132
pub struct DrawIndexedIndirectCommand {
33+
/// indexCount is the number of vertices to draw.
2234
pub index_count: u32,
35+
/// instanceCount is the number of instances to draw.
2336
pub instance_count: u32,
37+
/// firstIndex is the base index within the index buffer.
2438
pub first_index: u32,
39+
/// vertexOffset is the value added to the vertex index before indexing into the vertex buffer.
2540
pub vertex_offset: i32,
41+
/// firstInstance is the instance ID of the first instance to draw.
2642
pub first_instance: u32,
2743
}
2844

45+
/// Structure specifying an indirect dispatching command
46+
///
47+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDispatchIndirectCommand.html>
2948
#[repr(C)]
3049
#[derive(Copy, Clone, Debug, Default)]
31-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDispatchIndirectCommand.html>"]
3250
pub struct DispatchIndirectCommand {
51+
/// x is the number of local workgroups to dispatch in the X dimension.
3352
pub x: u32,
53+
/// y is the number of local workgroups to dispatch in the Y dimension.
3454
pub y: u32,
55+
/// z is the number of local workgroups to dispatch in the Z dimension.
3556
pub z: u32,
3657
}
3758

@@ -55,12 +76,17 @@ impl From<DispatchIndirectCommand> for UVec3 {
5576
}
5677
}
5778

79+
/// Structure specifying a mesh tasks draw indirect command
80+
///
81+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawMeshTasksIndirectCommandEXT.html>
5882
#[repr(C)]
5983
#[derive(Copy, Clone, Debug, Default)]
60-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkDrawMeshTasksIndirectCommandEXT.html>"]
6184
pub struct DrawMeshTasksIndirectCommandEXT {
85+
/// groupCountX is the number of local workgroups to dispatch in the X dimension.
6286
pub group_count_x: u32,
87+
/// groupCountY is the number of local workgroups to dispatch in the Y dimension.
6388
pub group_count_y: u32,
89+
/// groupCountZ is the number of local workgroups to dispatch in the Z dimension.
6490
pub group_count_z: u32,
6591
}
6692

@@ -84,12 +110,17 @@ impl From<DrawMeshTasksIndirectCommandEXT> for UVec3 {
84110
}
85111
}
86112

113+
/// Structure specifying the parameters of an indirect ray tracing command
114+
///
115+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkTraceRaysIndirectCommandKHR.html>
87116
#[repr(C)]
88117
#[derive(Copy, Clone, Debug, Default)]
89-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkTraceRaysIndirectCommandKHR.html>"]
90118
pub struct TraceRaysIndirectCommandKHR {
119+
/// width is the width of the ray trace query dimensions.
91120
pub width: u32,
121+
/// height is height of the ray trace query dimensions.
92122
pub height: u32,
123+
/// depth is depth of the ray trace query dimensions.
93124
pub depth: u32,
94125
}
95126

@@ -113,23 +144,39 @@ impl From<TraceRaysIndirectCommandKHR> for UVec3 {
113144
}
114145
}
115146

147+
/// Structure specifying the parameters of an indirect trace ray command with indirect shader binding tables
148+
///
149+
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkTraceRaysIndirectCommand2KHR.html>
116150
#[repr(C)]
117151
#[derive(Copy, Clone, Debug, Default)]
118-
#[doc = "<https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkTraceRaysIndirectCommand2KHR.html>"]
119152
#[must_use]
120153
pub struct TraceRaysIndirectCommand2KHR {
154+
/// raygenShaderRecordAddress is a `VkDeviceAddress` of the ray generation shader binding table record used by this command.
121155
pub raygen_shader_record_address: DeviceAddress,
156+
/// raygenShaderRecordSize is a `VkDeviceSize` number of bytes corresponding to the ray generation shader binding table record at base address raygenShaderRecordAddress.
122157
pub raygen_shader_record_size: DeviceSize,
158+
/// missShaderBindingTableAddress is a `VkDeviceAddress` of the first record in the miss shader binding table used by this command.
123159
pub miss_shader_binding_table_address: DeviceAddress,
160+
/// missShaderBindingTableSize is a `VkDeviceSize` number of bytes corresponding to the total size of the miss shader binding table at missShaderBindingTableAddress that may be accessed by this command.
124161
pub miss_shader_binding_table_size: DeviceSize,
162+
/// missShaderBindingTableStride is a `VkDeviceSize` number of bytes between records of the miss shader binding table.
125163
pub miss_shader_binding_table_stride: DeviceSize,
164+
/// hitShaderBindingTableAddress is a `VkDeviceAddress` of the first record in the hit shader binding table used by this command.
126165
pub hit_shader_binding_table_address: DeviceAddress,
166+
/// hitShaderBindingTableSize is a `VkDeviceSize` number of bytes corresponding to the total size of the hit shader binding table at hitShaderBindingTableAddress that may be accessed by this command.
127167
pub hit_shader_binding_table_size: DeviceSize,
168+
/// hitShaderBindingTableStride is a `VkDeviceSize` number of bytes between records of the hit shader binding table.
128169
pub hit_shader_binding_table_stride: DeviceSize,
170+
/// callableShaderBindingTableAddress is a `VkDeviceAddress` of the first record in the callable shader binding table used by this command.
129171
pub callable_shader_binding_table_address: DeviceAddress,
172+
/// callableShaderBindingTableSize is a `VkDeviceSize` number of bytes corresponding to the total size of the callable shader binding table at callableShaderBindingTableAddress that may be accessed by this command.
130173
pub callable_shader_binding_table_size: DeviceSize,
174+
/// callableShaderBindingTableStride is a `VkDeviceSize` number of bytes between records of the callable shader binding table.
131175
pub callable_shader_binding_table_stride: DeviceSize,
176+
/// width is the width of the ray trace query dimensions.
132177
pub width: u32,
178+
/// height is height of the ray trace query dimensions.
133179
pub height: u32,
180+
/// depth is depth of the ray trace query dimensions.
134181
pub depth: u32,
135182
}

0 commit comments

Comments
 (0)