From e5dc716a6fedf87a66f97eeb604c856f44299be0 Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Thu, 9 Jul 2020 11:06:09 -0400 Subject: [PATCH] [rs] Split render pass docs into multiple sections, divided by feature --- wgpu/src/lib.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index fc726425c6..80ed371e3a 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -1846,11 +1846,19 @@ impl<'a> RenderPass<'a> { .draw_indexed_indirect(&indirect_buffer.id, indirect_offset); } + /// Execute a [render bundle][RenderBundle], which is a set of pre-recorded commands + /// that can be run together. + pub fn execute_bundles>(&mut self, render_bundles: I) { + self.id + .execute_bundles(render_bundles.into_iter().map(|rb| &rb.id)) + } +} + +/// [`Features::MULTI_DRAW_INDIRECT`] must be enabled on the device in order to call these functions. +impl<'a> RenderPass<'a> { /// Disptaches multiple draw calls from the active vertex buffer(s) based on the contents of the `indirect_buffer`. /// `count` draw calls are issued. /// - /// [`Features::MULTI_DRAW_INDIRECT`] must be enabled on the device in order to call this function. - /// /// The active vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. /// /// The structure expected in `indirect_buffer` is the following: @@ -1879,8 +1887,6 @@ impl<'a> RenderPass<'a> { /// Disptaches multiple draw calls from the active index buffer and the active vertex buffers, /// based on the contents of the `indirect_buffer`. `count` draw calls are issued. /// - /// [`Features::MULTI_DRAW_INDIRECT`] must be enabled on the device in order to call this function. - /// /// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active /// vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. /// @@ -1907,15 +1913,16 @@ impl<'a> RenderPass<'a> { self.id .multi_draw_indexed_indirect(&indirect_buffer.id, indirect_offset, count); } +} +/// [`Features::MULTI_DRAW_INDIRECT_COUNT`] must be enabled on the device in order to call these functions. +impl<'a> RenderPass<'a> { /// Disptaches multiple draw calls from the active vertex buffer(s) based on the contents of the `indirect_buffer`. /// The count buffer is read to determine how many draws to issue. /// /// The indirect buffer must be long enough to account for `max_count` draws, however only `count` will /// draws will be read. If `count` is greater than `max_count`, `max_count` will be used. /// - /// [`Features::MULTI_DRAW_INDIRECT_COUNT`] must be enabled on the device in order to call this function. - /// /// The active vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. /// /// The structure expected in `indirect_buffer` is the following: @@ -1963,8 +1970,6 @@ impl<'a> RenderPass<'a> { /// The indirect buffer must be long enough to account for `max_count` draws, however only `count` will /// draws will be read. If `count` is greater than `max_count`, `max_count` will be used. /// - /// [`Features::MULTI_DRAW_INDIRECT_COUNT`] must be enabled on the device in order to call this function. - /// /// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active /// vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. /// @@ -2007,13 +2012,6 @@ impl<'a> RenderPass<'a> { max_count, ); } - - /// Execute a [render bundle][RenderBundle], which is a set of pre-recorded commands - /// that can be run together. - pub fn execute_bundles>(&mut self, render_bundles: I) { - self.id - .execute_bundles(render_bundles.into_iter().map(|rb| &rb.id)) - } } impl<'a> Drop for RenderPass<'a> {