Skip to content

Commit 4251490

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@e446551 🚀
1 parent 0714fc3 commit 4251490

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+248
-218
lines changed

doc/search-index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/search.desc/wgpu/wgpu-desc-0-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/search.desc/wgpu/wgpu-desc-1-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/search.desc/wgpu_types/wgpu_types-desc-0-.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/wgpu/api/device.rs.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,15 +1137,15 @@
11371137
/// # Validation
11381138
/// If any of the following is not satisfied a validation error is generated
11391139
///
1140-
/// The device ***must*** have [Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE] enabled.
1141-
/// if `sizes` is [BlasGeometrySizeDescriptors::Triangles] then the following must be satisfied
1140+
/// The device ***must*** have [`Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE`] enabled.
1141+
/// if `sizes` is [`BlasGeometrySizeDescriptors::Triangles`] then the following must be satisfied
11421142
/// - For every geometry descriptor (for the purposes this is called `geo_desc`) of `sizes.descriptors` the following must be satisfied:
11431143
/// - `geo_desc.vertex_format` must be within allowed formats (allowed formats for a given feature set
1144-
/// may be queried with [Features::allowed_vertex_formats_for_blas]).
1144+
/// may be queried with [`Features::allowed_vertex_formats_for_blas`]).
11451145
/// - Both or neither of `geo_desc.index_format` and `geo_desc.index_count` must be provided.
11461146
///
1147-
/// [Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE]: wgt::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
1148-
/// [Features::allowed_vertex_formats_for_blas]: wgt::Features::allowed_vertex_formats_for_blas
1147+
/// [`Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE`]: wgt::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
1148+
/// [`Features::allowed_vertex_formats_for_blas`]: wgt::Features::allowed_vertex_formats_for_blas
11491149
</span><span class="attr">#[must_use]
11501150
</span><span class="kw">pub fn </span>create_blas(
11511151
<span class="kw-2">&amp;</span><span class="self">self</span>,
@@ -1166,9 +1166,9 @@
11661166
/// # Validation
11671167
/// If any of the following is not satisfied a validation error is generated
11681168
///
1169-
/// The device ***must*** have [Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE] enabled.
1169+
/// The device ***must*** have [`Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE`] enabled.
11701170
///
1171-
/// [Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE]: wgt::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
1171+
/// [`Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE`]: wgt::Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
11721172
</span><span class="attr">#[must_use]
11731173
</span><span class="kw">pub fn </span>create_tlas(<span class="kw-2">&amp;</span><span class="self">self</span>, desc: <span class="kw-2">&amp;</span>CreateTlasDescriptor&lt;<span class="lifetime">'_</span>&gt;) -&gt; Tlas {
11741174
<span class="kw">let </span>tlas = <span class="self">self</span>.inner.create_tlas(desc);

doc/src/wgpu/api/mod.rs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@
178178
<span class="doccomment">/// Object debugging label.
179179
</span><span class="kw">pub type </span>Label&lt;<span class="lifetime">'a</span>&gt; = <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span><span class="lifetime">'a </span>str&gt;;
180180

181-
<span class="doccomment">/// A cute utility type that works just like PhantomData, but also
182-
/// implements Drop. This forces any lifetimes that are associated
183-
/// with the type to be used until the Drop impl is ran. This prevents
181+
<span class="doccomment">/// A cute utility type that works just like `PhantomData`, but also
182+
/// implements `Drop`. This forces any lifetimes that are associated
183+
/// with the type to be used until the `Drop` impl is ran. This prevents
184184
/// lifetimes from being shortened.
185185
</span><span class="attr">#[derive(Debug)]
186186
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct </span>PhantomDrop&lt;T&gt;(core::marker::PhantomData&lt;T&gt;);

doc/src/wgpu/api/render_pass.rs.html

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,13 @@
577577
<a href="#576" id="576">576</a>
578578
<a href="#577" id="577">577</a>
579579
<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;
581587

582588
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
583589
<span class="kw">pub use </span>wgt::{LoadOp, Operations, StoreOp};
@@ -751,12 +757,13 @@
751757
<span class="doccomment">/// Draws primitives from the active vertex buffer(s).
752758
///
753759
/// 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`]
755761
///
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.
757766
///
758-
/// vertices: The range of vertices to draw.
759-
/// instances: Range of Instances to draw. Use 0..1 if instance buffers are not used.
760767
/// E.g.of how its used internally
761768
/// ```rust ignore
762769
/// for instance_id in instance_range {
@@ -778,11 +785,12 @@
778785
/// The active index buffer can be set with [`RenderPass::set_index_buffer`]
779786
/// The active vertex buffers can be set with [`RenderPass::set_vertex_buffer`].
780787
///
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.
782793
///
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.
786794
/// E.g.of how its used internally
787795
/// ```rust ignore
788796
/// for instance_id in instance_range {
@@ -809,7 +817,7 @@
809817
/// Indirect drawing has some caveats depending on the features available. We are not currently able to validate
810818
/// these and issue an error.
811819
/// - 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.
813821
/// - If [`DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW`] is not present on the adapter,
814822
/// any use of `@builtin(vertex_index)` or `@builtin(instance_index)` in the vertex shader will have different values.
815823
///
@@ -828,7 +836,7 @@
828836
/// Indirect drawing has some caveats depending on the features available. We are not currently able to validate
829837
/// these and issue an error.
830838
/// - 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.
832840
/// - If [`DownlevelFlags::VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW`] is not present on the adapter,
833841
/// any use of `@builtin(vertex_index)` or `@builtin(instance_index)` in the vertex shader will have different values.
834842
///
@@ -951,7 +959,6 @@
951959
/// The active index buffer can be set with [`RenderPass::set_index_buffer`], while the active
952960
/// vertex buffers can be set with [`RenderPass::set_vertex_buffer`].
953961
///
954-
///
955962
/// The structure expected in `indirect_buffer` must conform to [`DrawIndexedIndirectArgs`](crate::util::DrawIndexedIndirectArgs).
956963
///
957964
/// These draw structures are expected to be tightly packed.
@@ -1048,13 +1055,15 @@
10481055

10491056
<span class="kw">impl </span>RenderPass&lt;<span class="lifetime">'_</span>&gt; {
10501057
<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.
10521060
</span><span class="kw">pub fn </span>begin_occlusion_query(<span class="kw-2">&amp;mut </span><span class="self">self</span>, query_index: u32) {
10531061
<span class="self">self</span>.inner.begin_occlusion_query(query_index);
10541062
}
10551063

10561064
<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.
10581067
</span><span class="kw">pub fn </span>end_occlusion_query(<span class="kw-2">&amp;mut </span><span class="self">self</span>) {
10591068
<span class="self">self</span>.inner.end_occlusion_query();
10601069
}
@@ -1063,14 +1072,16 @@
10631072
<span class="doccomment">/// [`Features::PIPELINE_STATISTICS_QUERY`] must be enabled on the device in order to call these functions.
10641073
</span><span class="kw">impl </span>RenderPass&lt;<span class="lifetime">'_</span>&gt; {
10651074
<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.
10671077
</span><span class="kw">pub fn </span>begin_pipeline_statistics_query(<span class="kw-2">&amp;mut </span><span class="self">self</span>, query_set: <span class="kw-2">&amp;</span>QuerySet, query_index: u32) {
10681078
<span class="self">self</span>.inner
10691079
.begin_pipeline_statistics_query(<span class="kw-2">&amp;</span>query_set.inner, query_index);
10701080
}
10711081

10721082
<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.
10741085
</span><span class="kw">pub fn </span>end_pipeline_statistics_query(<span class="kw-2">&amp;mut </span><span class="self">self</span>) {
10751086
<span class="self">self</span>.inner.end_pipeline_statistics_query();
10761087
}
@@ -1079,7 +1090,8 @@
10791090
<span class="doccomment">/// Describes the timestamp writes of a render pass.
10801091
///
10811092
/// 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`.
10831095
///
10841096
/// Corresponds to [WebGPU `GPURenderPassTimestampWrite`](
10851097
/// https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpasstimestampwrites).

doc/src/wgpu/api/texture_view.rs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@
7171
<span class="macro">crate::cmp::impl_eq_ord_hash_proxy!</span>(TextureView =&gt; .inner);
7272

7373
<span class="kw">impl </span>TextureView {
74-
<span class="doccomment">/// Returns the inner hal TextureView using a callback. The hal texture will be `None` if the
74+
<span class="doccomment">/// Returns the inner hal `TextureView` using a callback. The hal texture will be `None` if the
7575
/// backend type argument does not match with this wgpu Texture
7676
///
7777
/// # Safety
7878
///
79-
/// - The raw handle obtained from the hal TextureView must not be manually destroyed
79+
/// - The raw handle obtained from the hal `TextureView` must not be manually destroyed
8080
</span><span class="attr">#[cfg(wgpu_core)]
8181
</span><span class="kw">pub unsafe fn </span>as_hal&lt;A: wgc::hal_api::HalApi, F: FnOnce(<span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>A::TextureView&gt;) -&gt; R, R&gt;(
8282
<span class="kw-2">&amp;</span><span class="self">self</span>,

doc/src/wgpu/api/tlas.rs.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,18 @@
194194

195195
<span class="doccomment">/// Entry for a top level acceleration structure build.
196196
/// Used with raw instance buffers for an unvalidated builds.
197-
/// See [TlasPackage] for the safe version.
197+
/// See [`TlasPackage`] for the safe version.
198198
</span><span class="kw">pub struct </span>TlasBuildEntry&lt;<span class="lifetime">'a</span>&gt; {
199199
<span class="doccomment">/// Reference to the acceleration structure.
200200
</span><span class="kw">pub </span>tlas: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>Tlas,
201-
<span class="doccomment">/// Reference to the raw instance buffer, each instance is similar to [TlasInstance] but contains a handle to the BLAS.
201+
<span class="doccomment">/// Reference to the raw instance buffer, each instance is similar to [`TlasInstance`] but contains a handle to the BLAS.
202202
</span><span class="kw">pub </span>instance_buffer: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>Buffer,
203203
<span class="doccomment">/// Number of instances in the instance buffer.
204204
</span><span class="kw">pub </span>instance_count: u32,
205205
}
206206
<span class="macro">static_assertions::assert_impl_all!</span>(TlasBuildEntry&lt;<span class="lifetime">'_</span>&gt;: WasmNotSendSync);
207207

208-
<span class="doccomment">/// The safe version of TlasEntry, containing TlasInstances instead of a raw buffer.
208+
<span class="doccomment">/// The safe version of [`TlasBuildEntry`], containing [`TlasInstance`]s instead of a raw buffer.
209209
</span><span class="kw">pub struct </span>TlasPackage {
210210
<span class="kw">pub</span>(<span class="kw">crate</span>) tlas: Tlas,
211211
<span class="kw">pub</span>(<span class="kw">crate</span>) instances: Vec&lt;<span class="prelude-ty">Option</span>&lt;TlasInstance&gt;&gt;,
@@ -214,13 +214,13 @@
214214
<span class="macro">static_assertions::assert_impl_all!</span>(TlasPackage: WasmNotSendSync);
215215

216216
<span class="kw">impl </span>TlasPackage {
217-
<span class="doccomment">/// Construct [TlasPackage] consuming the [Tlas] (prevents modification of the [Tlas] without using this package).
217+
<span class="doccomment">/// Construct [`TlasPackage`] consuming the [`Tlas`] (prevents modification of the [`Tlas`] without using this package).
218218
</span><span class="kw">pub fn </span>new(tlas: Tlas) -&gt; <span class="self">Self </span>{
219219
<span class="kw">let </span>max_instances = tlas.shared.max_instances;
220220
<span class="self">Self</span>::new_with_instances(tlas, <span class="macro">vec!</span>[<span class="prelude-val">None</span>; max_instances <span class="kw">as </span>usize])
221221
}
222222

223-
<span class="doccomment">/// Construct [TlasPackage] consuming the [Tlas] (prevents modification of the Tlas without using this package).
223+
<span class="doccomment">/// Construct [`TlasPackage`] consuming the [`Tlas`] (prevents modification of the [`Tlas`] without using this package).
224224
/// This constructor moves the instances into the package (the number of instances needs to fit into tlas,
225225
/// otherwise when building a validation error will be raised).
226226
</span><span class="kw">pub fn </span>new_with_instances(tlas: Tlas, instances: Vec&lt;<span class="prelude-ty">Option</span>&lt;TlasInstance&gt;&gt;) -&gt; <span class="self">Self </span>{
@@ -242,7 +242,7 @@
242242
</span><span class="comment">// this recommendation is not useful yet, but is likely to be when ability to update arrives or possible optimisations for building get implemented.
243243
</span><span class="doccomment">/// For best performance it is recommended to prefer access to low elements and modify higher elements as little as possible.
244244
/// This can be done by ordering instances from the most to the least used. It is recommended
245-
/// to use [Self::index_mut] unless the option if out of bounds is required
245+
/// to use [`Self::index_mut`] unless the option if out of bounds is required
246246
</span><span class="kw">pub fn </span>get_mut_slice(<span class="kw-2">&amp;mut </span><span class="self">self</span>, range: Range&lt;usize&gt;) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;mut </span>[<span class="prelude-ty">Option</span>&lt;TlasInstance&gt;]&gt; {
247247
<span class="kw">if </span>range.end &gt; <span class="self">self</span>.instances.len() {
248248
<span class="kw">return </span><span class="prelude-val">None</span>;
@@ -259,7 +259,7 @@
259259
</span><span class="comment">// this recommendation is not useful yet, but is likely to be when ability to update arrives or possible optimisations for building get implemented.
260260
</span><span class="doccomment">/// For best performance it is recommended to prefer access to low elements and modify higher elements as little as possible.
261261
/// This can be done by ordering instances from the most to the least used. It is recommended
262-
/// to use [Self::index_mut] unless the option if out of bounds is required
262+
/// to use [`Self::index_mut`] unless the option if out of bounds is required
263263
</span><span class="kw">pub fn </span>get_mut_single(<span class="kw-2">&amp;mut </span><span class="self">self</span>, index: usize) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;mut </span><span class="prelude-ty">Option</span>&lt;TlasInstance&gt;&gt; {
264264
<span class="kw">if </span>index &gt;= <span class="self">self</span>.instances.len() {
265265
<span class="kw">return </span><span class="prelude-val">None</span>;
@@ -270,14 +270,14 @@
270270
<span class="prelude-val">Some</span>(<span class="kw-2">&amp;mut </span><span class="self">self</span>.instances[index])
271271
}
272272

273-
<span class="doccomment">/// Get the binding resource for the underling acceleration structure, to be used when creating a [BindGroup]
273+
<span class="doccomment">/// Get the binding resource for the underling acceleration structure, to be used when creating a [`BindGroup`]
274274
///
275-
/// [BindGroup]: super::BindGroup
275+
/// [`BindGroup`]: super::BindGroup
276276
</span><span class="kw">pub fn </span>as_binding(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; BindingResource&lt;<span class="lifetime">'_</span>&gt; {
277277
BindingResource::AccelerationStructure(<span class="kw-2">&amp;</span><span class="self">self</span>.tlas)
278278
}
279279

280-
<span class="doccomment">/// Get a reference to the underling [Tlas].
280+
<span class="doccomment">/// Get a reference to the underling [`Tlas`].
281281
</span><span class="kw">pub fn </span>tlas(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="kw-2">&amp;</span>Tlas {
282282
<span class="kw-2">&amp;</span><span class="self">self</span>.tlas
283283
}

0 commit comments

Comments
 (0)