|
577 | 577 | <a href="#576" id="576">576</a> |
578 | 578 | <a href="#577" id="577">577</a> |
579 | 579 | <a href="#578" id="578">578</a> |
580 | | -<a href="#579" id="579">579</a></pre></div><pre class="rust"><code><span class="kw">use </span>core::ops::Range; |
| 580 | +<a href="#579" id="579">579</a> |
| 581 | +<a href="#580" id="580">580</a> |
| 582 | +<a href="#581" id="581">581</a> |
| 583 | +<a href="#582" id="582">582</a> |
| 584 | +<a href="#583" id="583">583</a> |
| 585 | +<a href="#584" id="584">584</a> |
| 586 | +<a href="#585" id="585">585</a></pre></div><pre class="rust"><code><span class="kw">use </span>core::ops::Range; |
581 | 587 |
|
582 | 588 | <span class="kw">use crate</span>::<span class="kw-2">*</span>; |
583 | 589 | <span class="kw">pub use </span>wgt::{LoadOp, Operations, StoreOp}; |
|
751 | 757 | <span class="doccomment">/// Draws primitives from the active vertex buffer(s). |
752 | 758 | /// |
753 | 759 | /// The active vertex buffer(s) can be set with [`RenderPass::set_vertex_buffer`]. |
754 | | - /// Does not use an Index Buffer. If you need this see [`RenderPass::draw_indexed`] |
| 760 | + /// This does not use an index buffer. If you need indexed drawing, see [`RenderPass::draw_indexed`] |
755 | 761 | /// |
756 | | - /// Panics if vertices Range is outside of the range of the vertices range of any set vertex buffer. |
| 762 | + /// Panics if `vertices` range is outside of the range of the vertices range of any set vertex buffer. |
| 763 | + /// |
| 764 | + /// - `vertices`: The range of vertices to draw. |
| 765 | + /// - `instances`: Range of instances to draw. Use `0..1` if instance buffers are not used. |
757 | 766 | /// |
758 | | - /// vertices: The range of vertices to draw. |
759 | | - /// instances: Range of Instances to draw. Use 0..1 if instance buffers are not used. |
760 | 767 | /// E.g.of how its used internally |
761 | 768 | /// ```rust ignore |
762 | 769 | /// for instance_id in instance_range { |
|
778 | 785 | /// The active index buffer can be set with [`RenderPass::set_index_buffer`] |
779 | 786 | /// The active vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. |
780 | 787 | /// |
781 | | - /// Panics if indices Range is outside of the range of the indices range of any set index buffer. |
| 788 | + /// Panics if `indices` range is outside of the range of the indices range of the set index buffer. |
| 789 | + /// |
| 790 | + /// - `indices`: The range of indices to draw. |
| 791 | + /// - `base_vertex`: value added to each index value before indexing into the vertex buffers. |
| 792 | + /// - `instances`: Range of instances to draw. Use `0..1` if instance buffers are not used. |
782 | 793 | /// |
783 | | - /// indices: The range of indices to draw. |
784 | | - /// base_vertex: value added to each index value before indexing into the vertex buffers. |
785 | | - /// instances: Range of Instances to draw. Use 0..1 if instance buffers are not used. |
786 | 794 | /// E.g.of how its used internally |
787 | 795 | /// ```rust ignore |
788 | 796 | /// for instance_id in instance_range { |
|
809 | 817 | /// Indirect drawing has some caveats depending on the features available. We are not currently able to validate |
810 | 818 | /// these and issue an error. |
811 | 819 | /// - If [`Features::INDIRECT_FIRST_INSTANCE`] is not present on the adapter, |
812 | | - /// [`DrawIndirect::first_instance`](crate::util::DrawIndirectArgs::first_instance) will be ignored. |
| 820 | + /// [`DrawIndirectArgs::first_instance`](crate::util::DrawIndirectArgs::first_instance) will be ignored. |
813 | 821 | /// - If [`DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW`] is not present on the adapter, |
814 | 822 | /// any use of `@builtin(vertex_index)` or `@builtin(instance_index)` in the vertex shader will have different values. |
815 | 823 | /// |
|
828 | 836 | /// Indirect drawing has some caveats depending on the features available. We are not currently able to validate |
829 | 837 | /// these and issue an error. |
830 | 838 | /// - If [`Features::INDIRECT_FIRST_INSTANCE`] is not present on the adapter, |
831 | | - /// [`DrawIndexedIndirect::first_instance`](crate::util::DrawIndexedIndirectArgs::first_instance) will be ignored. |
| 839 | + /// [`DrawIndexedIndirectArgs::first_instance`](crate::util::DrawIndexedIndirectArgs::first_instance) will be ignored. |
832 | 840 | /// - If [`DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW`] is not present on the adapter, |
833 | 841 | /// any use of `@builtin(vertex_index)` or `@builtin(instance_index)` in the vertex shader will have different values. |
834 | 842 | /// |
|
951 | 959 | /// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active |
952 | 960 | /// vertex buffers can be set with [`RenderPass::set_vertex_buffer`]. |
953 | 961 | /// |
954 | | - /// |
955 | 962 | /// The structure expected in `indirect_buffer` must conform to [`DrawIndexedIndirectArgs`](crate::util::DrawIndexedIndirectArgs). |
956 | 963 | /// |
957 | 964 | /// These draw structures are expected to be tightly packed. |
|
1048 | 1055 |
|
1049 | 1056 | <span class="kw">impl </span>RenderPass<<span class="lifetime">'_</span>> { |
1050 | 1057 | <span class="doccomment">/// Start a occlusion query on this render pass. It can be ended with |
1051 | | - /// `end_occlusion_query`. Occlusion queries may not be nested. |
| 1058 | + /// [`end_occlusion_query`](Self::end_occlusion_query). |
| 1059 | + /// Occlusion queries may not be nested. |
1052 | 1060 | </span><span class="kw">pub fn </span>begin_occlusion_query(<span class="kw-2">&mut </span><span class="self">self</span>, query_index: u32) { |
1053 | 1061 | <span class="self">self</span>.inner.begin_occlusion_query(query_index); |
1054 | 1062 | } |
1055 | 1063 |
|
1056 | 1064 | <span class="doccomment">/// End the occlusion query on this render pass. It can be started with |
1057 | | - /// `begin_occlusion_query`. Occlusion queries may not be nested. |
| 1065 | + /// [`begin_occlusion_query`](Self::begin_occlusion_query). |
| 1066 | + /// Occlusion queries may not be nested. |
1058 | 1067 | </span><span class="kw">pub fn </span>end_occlusion_query(<span class="kw-2">&mut </span><span class="self">self</span>) { |
1059 | 1068 | <span class="self">self</span>.inner.end_occlusion_query(); |
1060 | 1069 | } |
|
1063 | 1072 | <span class="doccomment">/// [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled on the device in order to call these functions. |
1064 | 1073 | </span><span class="kw">impl </span>RenderPass<<span class="lifetime">'_</span>> { |
1065 | 1074 | <span class="doccomment">/// Start a pipeline statistics query on this render pass. It can be ended with |
1066 | | - /// `end_pipeline_statistics_query`. Pipeline statistics queries may not be nested. |
| 1075 | + /// [`end_pipeline_statistics_query`](Self::end_pipeline_statistics_query). |
| 1076 | + /// Pipeline statistics queries may not be nested. |
1067 | 1077 | </span><span class="kw">pub fn </span>begin_pipeline_statistics_query(<span class="kw-2">&mut </span><span class="self">self</span>, query_set: <span class="kw-2">&</span>QuerySet, query_index: u32) { |
1068 | 1078 | <span class="self">self</span>.inner |
1069 | 1079 | .begin_pipeline_statistics_query(<span class="kw-2">&</span>query_set.inner, query_index); |
1070 | 1080 | } |
1071 | 1081 |
|
1072 | 1082 | <span class="doccomment">/// End the pipeline statistics query on this render pass. It can be started with |
1073 | | - /// `begin_pipeline_statistics_query`. Pipeline statistics queries may not be nested. |
| 1083 | + /// [`begin_pipeline_statistics_query`](Self::begin_pipeline_statistics_query). |
| 1084 | + /// Pipeline statistics queries may not be nested. |
1074 | 1085 | </span><span class="kw">pub fn </span>end_pipeline_statistics_query(<span class="kw-2">&mut </span><span class="self">self</span>) { |
1075 | 1086 | <span class="self">self</span>.inner.end_pipeline_statistics_query(); |
1076 | 1087 | } |
|
1079 | 1090 | <span class="doccomment">/// Describes the timestamp writes of a render pass. |
1080 | 1091 | /// |
1081 | 1092 | /// For use with [`RenderPassDescriptor`]. |
1082 | | -/// At least one of `beginning_of_pass_write_index` and `end_of_pass_write_index` must be `Some`. |
| 1093 | +/// At least one of [`Self::beginning_of_pass_write_index`] and [`Self::end_of_pass_write_index`] |
| 1094 | +/// must be `Some`. |
1083 | 1095 | /// |
1084 | 1096 | /// Corresponds to [WebGPU `GPURenderPassTimestampWrite`]( |
1085 | 1097 | /// https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpasstimestampwrites). |
|
0 commit comments