@@ -1447,6 +1447,18 @@ impl<'a> RenderPass<'a> {
1447
1447
/// Draws primitives from the active vertex buffer(s) based on the contents of the `indirect_buffer`.
1448
1448
///
1449
1449
/// The active vertex buffers can be set with [`RenderPass::set_vertex_buffer`].
1450
+ ///
1451
+ /// The structure expected in `indirect_buffer` is the following:
1452
+ ///
1453
+ /// ```rust
1454
+ /// #[repr(C)]
1455
+ /// struct DrawIndirect {
1456
+ /// vertex_count: u32, // The number of vertices to draw.
1457
+ /// instance_count: u32, // The number of instances to draw.
1458
+ /// base_vertex: u32, // The Index of the first vertex to draw.
1459
+ /// base_instance: u32, // The instance ID of the first instance to draw.
1460
+ /// }
1461
+ /// ```
1450
1462
pub fn draw_indirect ( & mut self , indirect_buffer : & ' a Buffer , indirect_offset : BufferAddress ) {
1451
1463
unsafe {
1452
1464
wgn:: wgpu_render_pass_draw_indirect (
@@ -1462,6 +1474,19 @@ impl<'a> RenderPass<'a> {
1462
1474
///
1463
1475
/// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active
1464
1476
/// vertex buffers can be set with [`RenderPass::set_vertex_buffer`].
1477
+ ///
1478
+ /// The structure expected in `indirect_buffer` is the following:
1479
+ ///
1480
+ /// ```rust
1481
+ /// #[repr(C)]
1482
+ /// struct DrawIndexedIndirect {
1483
+ /// vertex_count: u32, // The number of vertices to draw.
1484
+ /// instance_count: u32, // The number of instances to draw.
1485
+ /// base_index: u32, // The base index within the index buffer.
1486
+ /// vertex_offset: i32, // The value added to the vertex index before indexing into the vertex buffer.
1487
+ /// base_instance: u32, // The instance ID of the first instance to draw.
1488
+ /// }
1489
+ /// ```
1465
1490
pub fn draw_indexed_indirect (
1466
1491
& mut self ,
1467
1492
indirect_buffer : & ' a Buffer ,
0 commit comments