428: Split render pass docs into multiple sections, divided by feature r=cwfitzgerald a=lachlansneff

This does not affect usage at all.

Here's what the docs look like:

<img width="1012" alt="Screen Shot 2020-07-09 at 11 11 30 AM" src="https://user-images.githubusercontent.com/31360811/87057532-fd974c00-c1d4-11ea-8c7f-913a893bcdef.png">


Co-authored-by: Lachlan Sneff <lachlan.sneff@gmail.com>
This commit is contained in:
bors[bot]
2020-07-09 19:01:07 +00:00
committed by GitHub

View File

@@ -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<I: Iterator<Item = &'a RenderBundle>>(&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<I: Iterator<Item = &'a RenderBundle>>(&mut self, render_bundles: I) {
self.id
.execute_bundles(render_bundles.into_iter().map(|rb| &rb.id))
}
}
impl<'a> Drop for RenderPass<'a> {