Skip to content

Commit 7779280

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@73eb83d 🚀
1 parent 3413951 commit 7779280

File tree

679 files changed

+4189
-2457
lines changed

Some content is hidden

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

679 files changed

+4189
-2457
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_core/wgpu_core-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-files.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/src/wgpu/api/blas.rs.html

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,55 @@
216216
<a href="#215" id="215">215</a>
217217
<a href="#216" id="216">216</a>
218218
<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};
219+
<a href="#218" id="218">218</a>
220+
<a href="#219" id="219">219</a>
221+
<a href="#220" id="220">220</a>
222+
<a href="#221" id="221">221</a>
223+
<a href="#222" id="222">222</a>
224+
<a href="#223" id="223">223</a>
225+
<a href="#224" id="224">224</a>
226+
<a href="#225" id="225">225</a>
227+
<a href="#226" id="226">226</a>
228+
<a href="#227" id="227">227</a>
229+
<a href="#228" id="228">228</a>
230+
<a href="#229" id="229">229</a>
231+
<a href="#230" id="230">230</a>
232+
<a href="#231" id="231">231</a>
233+
<a href="#232" id="232">232</a>
234+
<a href="#233" id="233">233</a>
235+
<a href="#234" id="234">234</a>
236+
<a href="#235" id="235">235</a>
237+
<a href="#236" id="236">236</a>
238+
<a href="#237" id="237">237</a>
239+
<a href="#238" id="238">238</a>
240+
<a href="#239" id="239">239</a>
241+
<a href="#240" id="240">240</a>
242+
<a href="#241" id="241">241</a>
243+
<a href="#242" id="242">242</a>
244+
<a href="#243" id="243">243</a>
245+
<a href="#244" id="244">244</a>
246+
<a href="#245" id="245">245</a>
247+
<a href="#246" id="246">246</a>
248+
<a href="#247" id="247">247</a>
249+
<a href="#248" id="248">248</a>
250+
<a href="#249" id="249">249</a>
251+
<a href="#250" id="250">250</a>
252+
<a href="#251" id="251">251</a>
253+
<a href="#252" id="252">252</a>
254+
<a href="#253" id="253">253</a>
255+
<a href="#254" id="254">254</a>
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>
263+
<a href="#262" id="262">262</a>
264+
<a href="#263" id="263">263</a>
265+
<a href="#264" id="264">264</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, vec::Vec};
220266

221-
<span class="kw">use </span>wgt::WasmNotSendSync;
267+
<span class="kw">use </span>wgt::{WasmNotSend, WasmNotSendSync};
222268

223269
<span class="kw">use </span><span class="kw">crate</span>::dispatch;
224270
<span class="kw">use crate</span>::{Buffer, Label};
@@ -434,4 +480,50 @@
434480
<span class="attr">#[expect(dead_code)]
435481
</span><span class="kw">pub</span>(<span class="kw">crate</span>) geometries: ContextBlasGeometries&lt;<span class="lifetime">'a</span>&gt;,
436482
}
483+
484+
<span class="doccomment">/// Error occurred when trying to asynchronously prepare a blas for compaction.
485+
</span><span class="attr">#[derive(Clone, PartialEq, Eq, Debug)]
486+
</span><span class="kw">pub struct </span>BlasAsyncError;
487+
<span class="macro">static_assertions::assert_impl_all!</span>(BlasAsyncError: Send, Sync);
488+
489+
<span class="kw">impl </span>core::fmt::Display <span class="kw">for </span>BlasAsyncError {
490+
<span class="kw">fn </span>fmt(<span class="kw-2">&amp;</span><span class="self">self</span>, f: <span class="kw-2">&amp;mut </span>core::fmt::Formatter&lt;<span class="lifetime">'_</span>&gt;) -&gt; core::fmt::Result {
491+
<span class="macro">write!</span>(
492+
f,
493+
<span class="string">"Error occurred when trying to asynchronously prepare a blas for compaction"
494+
</span>)
495+
}
496+
}
497+
498+
<span class="kw">impl </span>core::error::Error <span class="kw">for </span>BlasAsyncError {}
499+
500+
<span class="kw">impl </span>Blas {
501+
<span class="doccomment">/// Asynchronously prepares this BLAS for compaction. The callback is called once all builds
502+
/// using this BLAS are finished and the BLAS is compactable. This can be checked using
503+
/// [`Blas::ready_for_compaction`]. Rebuilding this BLAS will reset its compacted state, and it
504+
/// will need to be prepared again.
505+
///
506+
/// ### Interaction with other functions
507+
/// On native, `queue.submit(..)` and polling devices (that is calling `instance.poll_all` or
508+
/// `device.poll`) with [`PollType::Poll`] may call the callback. On native, polling devices with
509+
/// [`PollType::Wait`] (or [`PollType::WaitForSubmissionIndex`] with a submission index greater
510+
/// than the last submit the BLAS was used in) will guarantee callback is called.
511+
///
512+
/// [`PollType::Poll`]: wgpu_types::PollType::Poll
513+
/// [`PollType::Wait`]: wgpu_types::PollType::Wait
514+
/// [`PollType::WaitForSubmissionIndex`]: wgpu_types::PollType::WaitForSubmissionIndex
515+
</span><span class="kw">pub fn </span>prepare_compaction_async(
516+
<span class="kw-2">&amp;</span><span class="self">self</span>,
517+
callback: <span class="kw">impl </span>FnOnce(<span class="prelude-ty">Result</span>&lt;(), BlasAsyncError&gt;) + WasmNotSend + <span class="lifetime">'static</span>,
518+
) {
519+
<span class="self">self</span>.inner.prepare_compact_async(Box::new(callback));
520+
}
521+
522+
<span class="doccomment">/// Checks whether this BLAS is ready for compaction. The returned value is `true` if
523+
/// [`Blas::prepare_compaction_async`]'s callback was called with a non-error value, otherwise
524+
/// this is `false`.
525+
</span><span class="kw">pub fn </span>ready_for_compaction(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
526+
<span class="self">self</span>.inner.ready_for_compaction()
527+
}
528+
}
437529
</code></pre></div></section></main></body></html>

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,20 @@
302302
<a href="#301" id="301">301</a>
303303
<a href="#302" id="302">302</a>
304304
<a href="#303" id="303">303</a>
305-
<a href="#304" id="304">304</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::boxed::Box;
305+
<a href="#304" id="304">304</a>
306+
<a href="#305" id="305">305</a>
307+
<a href="#306" id="306">306</a>
308+
<a href="#307" id="307">307</a>
309+
<a href="#308" id="308">308</a>
310+
<a href="#309" id="309">309</a>
311+
<a href="#310" id="310">310</a>
312+
<a href="#311" id="311">311</a>
313+
<a href="#312" id="312">312</a>
314+
<a href="#313" id="313">313</a>
315+
<a href="#314" id="314">314</a>
316+
<a href="#315" id="315">315</a>
317+
<a href="#316" id="316">316</a>
318+
<a href="#317" id="317">317</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::boxed::Box;
306319
<span class="kw">use </span>core::ops::{Deref, DerefMut};
307320

308321
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
@@ -605,5 +618,18 @@
605618
hal_queue_callback(<span class="prelude-val">None</span>)
606619
}
607620
}
621+
622+
<span class="doccomment">/// Compact a BLAS, it must have had [`Blas::prepare_compaction_async`] called on it and had the
623+
/// callback provided called.
624+
///
625+
/// The returned BLAS is more restricted than a normal BLAS because it may not be rebuilt or
626+
/// compacted.
627+
</span><span class="kw">pub fn </span>compact_blas(<span class="kw-2">&amp;</span><span class="self">self</span>, blas: <span class="kw-2">&amp;</span>Blas) -&gt; Blas {
628+
<span class="kw">let </span>(handle, dispatch) = <span class="self">self</span>.inner.compact_blas(<span class="kw-2">&amp;</span>blas.inner);
629+
Blas {
630+
handle,
631+
inner: dispatch,
632+
}
633+
}
608634
}
609635
</code></pre></div></section></main></body></html>

0 commit comments

Comments
 (0)