Skip to content

Commit 9a8a40e

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@efbac5d 🚀
1 parent 1fc761b commit 9a8a40e

File tree

1,346 files changed

+6123
-5909
lines changed

Some content is hidden

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

1,346 files changed

+6123
-5909
lines changed

doc/search-index.js

Lines changed: 2 additions & 2 deletions
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/blas.rs.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@
215215
<a href="#214" id="214">214</a>
216216
<a href="#215" id="215">215</a>
217217
<a href="#216" id="216">216</a>
218-
<a href="#217" id="217">217</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, vec::Vec};
218+
<a href="#217" id="217">217</a>
219+
<a href="#218" id="218">218</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, vec::Vec};
219220

220221
<span class="kw">use </span>wgt::WasmNotSendSync;
221222

@@ -317,7 +318,8 @@
317318
</span><span class="kw">pub </span>vertex_buffer: <span class="kw-2">&amp;</span><span class="lifetime">'a </span>Buffer,
318319
<span class="doccomment">/// Offset into the vertex buffer as a factor of the vertex stride.
319320
</span><span class="kw">pub </span>first_vertex: u32,
320-
<span class="doccomment">/// Vertex stride.
321+
<span class="doccomment">/// Vertex stride, must be greater than [`wgpu_types::VertexFormat::min_acceleration_structure_vertex_stride`]
322+
/// of the format and must be a multiple of [`wgpu_types::VertexFormat::acceleration_structure_stride_alignment`].
321323
</span><span class="kw">pub </span>vertex_stride: wgt::BufferAddress,
322324
<span class="doccomment">/// Index buffer (optional).
323325
</span><span class="kw">pub </span>index_buffer: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span><span class="lifetime">'a </span>Buffer&gt;,

doc/src/wgpu_core/command/ray_tracing.rs.html

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,36 @@
12671267
<a href="#1266" id="1266">1266</a>
12681268
<a href="#1267" id="1267">1267</a>
12691269
<a href="#1268" id="1268">1268</a>
1270-
<a href="#1269" id="1269">1269</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, sync::Arc, vec::Vec};
1270+
<a href="#1269" id="1269">1269</a>
1271+
<a href="#1270" id="1270">1270</a>
1272+
<a href="#1271" id="1271">1271</a>
1273+
<a href="#1272" id="1272">1272</a>
1274+
<a href="#1273" id="1273">1273</a>
1275+
<a href="#1274" id="1274">1274</a>
1276+
<a href="#1275" id="1275">1275</a>
1277+
<a href="#1276" id="1276">1276</a>
1278+
<a href="#1277" id="1277">1277</a>
1279+
<a href="#1278" id="1278">1278</a>
1280+
<a href="#1279" id="1279">1279</a>
1281+
<a href="#1280" id="1280">1280</a>
1282+
<a href="#1281" id="1281">1281</a>
1283+
<a href="#1282" id="1282">1282</a>
1284+
<a href="#1283" id="1283">1283</a>
1285+
<a href="#1284" id="1284">1284</a>
1286+
<a href="#1285" id="1285">1285</a>
1287+
<a href="#1286" id="1286">1286</a>
1288+
<a href="#1287" id="1287">1287</a>
1289+
<a href="#1288" id="1288">1288</a>
1290+
<a href="#1289" id="1289">1289</a>
1291+
<a href="#1290" id="1290">1290</a>
1292+
<a href="#1291" id="1291">1291</a>
1293+
<a href="#1292" id="1292">1292</a>
1294+
<a href="#1293" id="1293">1293</a>
1295+
<a href="#1294" id="1294">1294</a>
1296+
<a href="#1295" id="1295">1295</a>
1297+
<a href="#1296" id="1296">1296</a>
1298+
<a href="#1297" id="1297">1297</a>
1299+
<a href="#1298" id="1298">1298</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, sync::Arc, vec::Vec};
12711300
<span class="kw">use </span>core::{
12721301
cmp::max,
12731302
num::NonZeroU64,
@@ -2167,6 +2196,35 @@
21672196
));
21682197
}
21692198

2199+
<span class="kw">if </span>size_desc
2200+
.vertex_format
2201+
.min_acceleration_structure_vertex_stride()
2202+
&gt; mesh.vertex_stride
2203+
{
2204+
<span class="kw">return </span><span class="prelude-val">Err</span>(BuildAccelerationStructureError::VertexStrideTooSmall(
2205+
blas.error_ident(),
2206+
size_desc
2207+
.vertex_format
2208+
.min_acceleration_structure_vertex_stride(),
2209+
mesh.vertex_stride,
2210+
));
2211+
}
2212+
2213+
<span class="kw">if </span>mesh.vertex_stride
2214+
% size_desc
2215+
.vertex_format
2216+
.acceleration_structure_stride_alignment()
2217+
!= <span class="number">0
2218+
</span>{
2219+
<span class="kw">return </span><span class="prelude-val">Err</span>(BuildAccelerationStructureError::VertexStrideUnaligned(
2220+
blas.error_ident(),
2221+
size_desc
2222+
.vertex_format
2223+
.acceleration_structure_stride_alignment(),
2224+
mesh.vertex_stride,
2225+
));
2226+
}
2227+
21702228
<span class="kw">match </span>(size_desc.index_count, mesh.size.index_count) {
21712229
(<span class="prelude-val">Some</span>(<span class="kw">_</span>), <span class="prelude-val">None</span>) | (<span class="prelude-val">None</span>, <span class="prelude-val">Some</span>(<span class="kw">_</span>)) =&gt; {
21722230
<span class="kw">return </span><span class="prelude-val">Err</span>(

doc/src/wgpu_core/ray_tracing.rs.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@
253253
<a href="#252" id="252">252</a>
254254
<a href="#253" id="253">253</a>
255255
<a href="#254" id="254">254</a>
256-
<a href="#255" id="255">255</a></pre></div><pre class="rust"><code><span class="comment">// Ray tracing
256+
<a href="#255" id="255">255</a>
257+
<a href="#256" id="256">256</a>
258+
<a href="#257" id="257">257</a>
259+
<a href="#258" id="258">258</a>
260+
<a href="#259" id="259">259</a>
261+
<a href="#260" id="260">260</a>
262+
<a href="#261" id="261">261</a></pre></div><pre class="rust"><code><span class="comment">// Ray tracing
257263
// Major missing optimizations (no api surface changes needed):
258264
// - use custom tracker to track build state
259265
// - no forced rebuilt (build mode deduction)
@@ -357,6 +363,12 @@
357363
<span class="attr">#[error(<span class="string">"Blas {0:?} vertex formats are different, creation format: {1:?}, provided: {2:?}"</span>)]
358364
</span>DifferentBlasVertexFormats(ResourceErrorIdent, VertexFormat, VertexFormat),
359365

366+
<span class="attr">#[error(<span class="string">"Blas {0:?} stride was required to be at least {1} but stride given was {2}"</span>)]
367+
</span>VertexStrideTooSmall(ResourceErrorIdent, u64, u64),
368+
369+
<span class="attr">#[error(<span class="string">"Blas {0:?} stride was required to be a multiple of {1} but stride given was {2}"</span>)]
370+
</span>VertexStrideUnaligned(ResourceErrorIdent, u64, u64),
371+
360372
<span class="attr">#[error(<span class="string">"Blas {0:?} index count was provided at creation or building, but not the other"</span>)]
361373
</span>BlasIndexCountProvidedMismatch(ResourceErrorIdent),
362374

doc/src/wgpu_hal/vulkan/adapter.rs.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,7 +2757,8 @@
27572757
<a href="#2756" id="2756">2756</a>
27582758
<a href="#2757" id="2757">2757</a>
27592759
<a href="#2758" id="2758">2758</a>
2760-
<a href="#2759" id="2759">2759</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::ToOwned <span class="kw">as _</span>, collections::BTreeMap, sync::Arc, vec::Vec};
2760+
<a href="#2759" id="2759">2759</a>
2761+
<a href="#2760" id="2760">2760</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::ToOwned <span class="kw">as _</span>, collections::BTreeMap, sync::Arc, vec::Vec};
27612762
<span class="kw">use </span>core::ffi::CStr;
27622763

27632764
<span class="kw">use </span>ash::{ext, google, khr, vk};
@@ -3558,7 +3559,8 @@
35583559
features.set(F::DEPTH32FLOAT_STENCIL8, texture_d32_s8);
35593560

35603561
features.set(
3561-
F::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE,
3562+
F::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE
3563+
| F::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS,
35623564
caps.supports_extension(khr::deferred_host_operations::NAME)
35633565
&amp;&amp; caps.supports_extension(khr::acceleration_structure::NAME)
35643566
&amp;&amp; caps.supports_extension(khr::buffer_device_address::NAME),

doc/src/wgpu_types/features.rs.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,23 @@
15971597
<a href="#1596" id="1596">1596</a>
15981598
<a href="#1597" id="1597">1597</a>
15991599
<a href="#1598" id="1598">1598</a>
1600-
<a href="#1599" id="1599">1599</a></pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::VertexFormat;
1600+
<a href="#1599" id="1599">1599</a>
1601+
<a href="#1600" id="1600">1600</a>
1602+
<a href="#1601" id="1601">1601</a>
1603+
<a href="#1602" id="1602">1602</a>
1604+
<a href="#1603" id="1603">1603</a>
1605+
<a href="#1604" id="1604">1604</a>
1606+
<a href="#1605" id="1605">1605</a>
1607+
<a href="#1606" id="1606">1606</a>
1608+
<a href="#1607" id="1607">1607</a>
1609+
<a href="#1608" id="1608">1608</a>
1610+
<a href="#1609" id="1609">1609</a>
1611+
<a href="#1610" id="1610">1610</a>
1612+
<a href="#1611" id="1611">1611</a>
1613+
<a href="#1612" id="1612">1612</a>
1614+
<a href="#1613" id="1613">1613</a>
1615+
<a href="#1614" id="1614">1614</a>
1616+
<a href="#1615" id="1615">1615</a></pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::VertexFormat;
16011617
<span class="attr">#[cfg(feature = <span class="string">"serde"</span>)]
16021618
</span><span class="kw">use </span>alloc::fmt;
16031619
<span class="kw">use </span>alloc::vec::Vec;
@@ -2816,6 +2832,15 @@
28162832
///
28172833
/// This is a native only feature.
28182834
</span><span class="kw">const </span>EXPERIMENTAL_MESH_SHADER_MULTIVIEW = <span class="number">1 </span>&lt;&lt; <span class="number">49</span>;
2835+
2836+
<span class="doccomment">/// Allows usage of additional vertex formats in [BlasTriangleGeometrySizeDescriptor::vertex_format]
2837+
///
2838+
/// Supported platforms
2839+
/// - Vulkan
2840+
/// - DX12
2841+
///
2842+
/// [BlasTriangleGeometrySizeDescriptor::vertex_format]: super::BlasTriangleGeometrySizeDescriptor
2843+
</span><span class="kw">const </span>EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS = <span class="number">1 </span>&lt;&lt; <span class="number">50</span>;
28192844
}
28202845

28212846
<span class="doccomment">/// Features that are not guaranteed to be supported.
@@ -3083,6 +3108,13 @@
30833108
<span class="kw">if </span><span class="self">self</span>.contains(<span class="self">Self</span>::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE) {
30843109
formats.push(VertexFormat::Float32x3);
30853110
}
3111+
<span class="kw">if </span><span class="self">self</span>.contains(<span class="self">Self</span>::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS) {
3112+
formats.push(VertexFormat::Float32x2);
3113+
formats.push(VertexFormat::Float16x2);
3114+
formats.push(VertexFormat::Float16x4);
3115+
formats.push(VertexFormat::Snorm16x2);
3116+
formats.push(VertexFormat::Snorm16x4);
3117+
}
30863118
formats
30873119
}
30883120
}

doc/src/wgpu_types/lib.rs.html

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7780,7 +7780,37 @@
77807780
<a href="#7779" id="7779">7779</a>
77817781
<a href="#7780" id="7780">7780</a>
77827782
<a href="#7781" id="7781">7781</a>
7783-
<a href="#7782" id="7782">7782</a></pre></div><pre class="rust"><code><span class="doccomment">//! This library describes the API surface of WebGPU that is agnostic of the backend.
7783+
<a href="#7782" id="7782">7782</a>
7784+
<a href="#7783" id="7783">7783</a>
7785+
<a href="#7784" id="7784">7784</a>
7786+
<a href="#7785" id="7785">7785</a>
7787+
<a href="#7786" id="7786">7786</a>
7788+
<a href="#7787" id="7787">7787</a>
7789+
<a href="#7788" id="7788">7788</a>
7790+
<a href="#7789" id="7789">7789</a>
7791+
<a href="#7790" id="7790">7790</a>
7792+
<a href="#7791" id="7791">7791</a>
7793+
<a href="#7792" id="7792">7792</a>
7794+
<a href="#7793" id="7793">7793</a>
7795+
<a href="#7794" id="7794">7794</a>
7796+
<a href="#7795" id="7795">7795</a>
7797+
<a href="#7796" id="7796">7796</a>
7798+
<a href="#7797" id="7797">7797</a>
7799+
<a href="#7798" id="7798">7798</a>
7800+
<a href="#7799" id="7799">7799</a>
7801+
<a href="#7800" id="7800">7800</a>
7802+
<a href="#7801" id="7801">7801</a>
7803+
<a href="#7802" id="7802">7802</a>
7804+
<a href="#7803" id="7803">7803</a>
7805+
<a href="#7804" id="7804">7804</a>
7806+
<a href="#7805" id="7805">7805</a>
7807+
<a href="#7806" id="7806">7806</a>
7808+
<a href="#7807" id="7807">7807</a>
7809+
<a href="#7808" id="7808">7808</a>
7810+
<a href="#7809" id="7809">7809</a>
7811+
<a href="#7810" id="7810">7810</a>
7812+
<a href="#7811" id="7811">7811</a>
7813+
<a href="#7812" id="7812">7812</a></pre></div><pre class="rust"><code><span class="doccomment">//! This library describes the API surface of WebGPU that is agnostic of the backend.
77847814
//! This API is used for targeting both Web and Native.
77857815

77867816
</span><span class="attr">#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
@@ -12756,6 +12786,36 @@
1275612786
<span class="self">Self</span>::Float64x4 =&gt; <span class="number">32</span>,
1275712787
}
1275812788
}
12789+
12790+
<span class="doccomment">/// Returns the size read by an acceleration structure build of the vertex format. This is
12791+
/// slightly different from [`Self::size`] because the alpha component of 4-component formats
12792+
/// are not read in an acceleration structure build, allowing for a smaller stride.
12793+
</span><span class="attr">#[must_use]
12794+
</span><span class="kw">pub const fn </span>min_acceleration_structure_vertex_stride(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; u64 {
12795+
<span class="kw">match </span><span class="self">self </span>{
12796+
<span class="self">Self</span>::Float16x2 | <span class="self">Self</span>::Snorm16x2 =&gt; <span class="number">4</span>,
12797+
<span class="self">Self</span>::Float32x3 =&gt; <span class="number">12</span>,
12798+
<span class="self">Self</span>::Float32x2 =&gt; <span class="number">8</span>,
12799+
<span class="comment">// This is the minimum value from DirectX
12800+
// &gt; A16 component is ignored, other data can be packed there, such as setting vertex stride to 6 bytes
12801+
//
12802+
// https://microsoft.github.io/DirectX-Specs/d3d/Raytracing.html#d3d12_raytracing_geometry_triangles_desc
12803+
//
12804+
// Vulkan does not express a minimum stride.
12805+
</span><span class="self">Self</span>::Float16x4 | <span class="self">Self</span>::Snorm16x4 =&gt; <span class="number">6</span>,
12806+
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
12807+
}
12808+
}
12809+
12810+
<span class="doccomment">/// Returns the alignment required for `wgpu::BlasTriangleGeometry::vertex_stride`
12811+
</span><span class="attr">#[must_use]
12812+
</span><span class="kw">pub const fn </span>acceleration_structure_stride_alignment(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; u64 {
12813+
<span class="kw">match </span><span class="self">self </span>{
12814+
<span class="self">Self</span>::Float16x4 | <span class="self">Self</span>::Float16x2 | <span class="self">Self</span>::Snorm16x4 | <span class="self">Self</span>::Snorm16x2 =&gt; <span class="number">2</span>,
12815+
<span class="self">Self</span>::Float32x2 | <span class="self">Self</span>::Float32x3 =&gt; <span class="number">4</span>,
12816+
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
12817+
}
12818+
}
1275912819
}
1276012820

1276112821
<span class="macro">bitflags::bitflags!</span> {
@@ -15218,7 +15278,7 @@
1521815278
</span><span class="kw">pub struct </span>BlasTriangleGeometrySizeDescriptor {
1521915279
<span class="doccomment">/// Format of a vertex position, must be [`VertexFormat::Float32x3`]
1522015280
/// with just [`Features::EXPERIMENTAL_RAY_TRACING_ACCELERATION_STRUCTURE`]
15221-
/// but later features may add more formats.
15281+
/// but [`Features::EXTENDED_ACCELERATION_STRUCTURE_VERTEX_FORMATS`] adds more.
1522215282
</span><span class="kw">pub </span>vertex_format: VertexFormat,
1522315283
<span class="doccomment">/// Number of vertices.
1522415284
</span><span class="kw">pub </span>vertex_count: u32,

0 commit comments

Comments
 (0)