Skip to content

Commit 88a3de0

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@c860a2c 🚀
1 parent 4fd9563 commit 88a3de0

File tree

194 files changed

+1023
-759
lines changed

Some content is hidden

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

194 files changed

+1023
-759
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/search.desc/wgpu_hal/wgpu_hal-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: 109 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,58 @@
728728
<a href="#727" id="727">727</a>
729729
<a href="#728" id="728">728</a>
730730
<a href="#729" id="729">729</a>
731-
<a href="#730" id="730">730</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, string::String, sync::Arc};
731+
<a href="#730" id="730">730</a>
732+
<a href="#731" id="731">731</a>
733+
<a href="#732" id="732">732</a>
734+
<a href="#733" id="733">733</a>
735+
<a href="#734" id="734">734</a>
736+
<a href="#735" id="735">735</a>
737+
<a href="#736" id="736">736</a>
738+
<a href="#737" id="737">737</a>
739+
<a href="#738" id="738">738</a>
740+
<a href="#739" id="739">739</a>
741+
<a href="#740" id="740">740</a>
742+
<a href="#741" id="741">741</a>
743+
<a href="#742" id="742">742</a>
744+
<a href="#743" id="743">743</a>
745+
<a href="#744" id="744">744</a>
746+
<a href="#745" id="745">745</a>
747+
<a href="#746" id="746">746</a>
748+
<a href="#747" id="747">747</a>
749+
<a href="#748" id="748">748</a>
750+
<a href="#749" id="749">749</a>
751+
<a href="#750" id="750">750</a>
752+
<a href="#751" id="751">751</a>
753+
<a href="#752" id="752">752</a>
754+
<a href="#753" id="753">753</a>
755+
<a href="#754" id="754">754</a>
756+
<a href="#755" id="755">755</a>
757+
<a href="#756" id="756">756</a>
758+
<a href="#757" id="757">757</a>
759+
<a href="#758" id="758">758</a>
760+
<a href="#759" id="759">759</a>
761+
<a href="#760" id="760">760</a>
762+
<a href="#761" id="761">761</a>
763+
<a href="#762" id="762">762</a>
764+
<a href="#763" id="763">763</a>
765+
<a href="#764" id="764">764</a>
766+
<a href="#765" id="765">765</a>
767+
<a href="#766" id="766">766</a>
768+
<a href="#767" id="767">767</a>
769+
<a href="#768" id="768">768</a>
770+
<a href="#769" id="769">769</a>
771+
<a href="#770" id="770">770</a>
772+
<a href="#771" id="771">771</a>
773+
<a href="#772" id="772">772</a>
774+
<a href="#773" id="773">773</a>
775+
<a href="#774" id="774">774</a>
776+
<a href="#775" id="775">775</a>
777+
<a href="#776" id="776">776</a>
778+
<a href="#777" id="777">777</a>
779+
<a href="#778" id="778">778</a>
780+
<a href="#779" id="779">779</a>
781+
<a href="#780" id="780">780</a>
782+
<a href="#781" id="781">781</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, string::String, sync::Arc};
732783
<span class="kw">use </span>core::{error, fmt, future::Future};
733784

734785
<span class="kw">use </span>parking_lot::Mutex;
@@ -1107,14 +1158,65 @@
11071158
<span class="self">self</span>.inner.pop_error_scope()
11081159
}
11091160

1110-
<span class="doccomment">/// Starts frame capture.
1111-
</span><span class="kw">pub fn </span>start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1112-
<span class="self">self</span>.inner.start_capture()
1161+
<span class="doccomment">/// Starts a capture in the attached graphics debugger.
1162+
///
1163+
/// This behaves differently depending on which graphics debugger is attached:
1164+
///
1165+
/// - Renderdoc: Calls [`StartFrameCapture(device, NULL)`][rd].
1166+
/// - Xcode: Creates a capture with [`MTLCaptureManager`][xcode].
1167+
/// - None: No action is taken.
1168+
///
1169+
/// # Safety
1170+
///
1171+
/// - There should not be any other captures currently active.
1172+
/// - All other safety rules are defined by the graphics debugger, see the
1173+
/// documentation for the specific debugger.
1174+
/// - In general, graphics debuggers can easily cause crashes, so this isn't
1175+
/// ever guaranteed to be sound.
1176+
///
1177+
/// # Tips
1178+
///
1179+
/// - Debuggers need to capture both the recording of the commands and the
1180+
/// submission of the commands to the GPU. Try to wrap all of your
1181+
/// gpu work in a capture.
1182+
/// - If you encounter issues, try waiting for the GPU to finish all work
1183+
/// before stopping the capture.
1184+
///
1185+
/// [rd]: https://renderdoc.org/docs/in_application_api.html#_CPPv417StartFrameCapture23RENDERDOC_DevicePointer22RENDERDOC_WindowHandle
1186+
/// [xcode]: https://developer.apple.com/documentation/metal/mtlcapturemanager
1187+
</span><span class="attr">#[doc(alias = <span class="string">"start_renderdoc_capture"</span>)]
1188+
#[doc(alias = <span class="string">"start_xcode_capture"</span>)]
1189+
</span><span class="kw">pub unsafe fn </span>start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1190+
<span class="kw">unsafe </span>{ <span class="self">self</span>.inner.start_graphics_debugger_capture() }
11131191
}
11141192

1115-
<span class="doccomment">/// Stops frame capture.
1116-
</span><span class="kw">pub fn </span>stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1117-
<span class="self">self</span>.inner.stop_capture()
1193+
<span class="doccomment">/// Stops the current capture in the attached graphics debugger.
1194+
///
1195+
/// This behaves differently depending on which graphics debugger is attached:
1196+
///
1197+
/// - Renderdoc: Calls [`EndFrameCapture(device, NULL)`][rd].
1198+
/// - Xcode: Stops the capture with [`MTLCaptureManager`][xcode].
1199+
/// - None: No action is taken.
1200+
///
1201+
/// # Safety
1202+
///
1203+
/// - There should be a capture currently active.
1204+
/// - All other safety rules are defined by the graphics debugger, see the
1205+
/// documentation for the specific debugger.
1206+
/// - In general, graphics debuggers can easily cause crashes, so this isn't
1207+
/// ever guaranteed to be sound.
1208+
///
1209+
/// # Tips
1210+
///
1211+
/// - If you encounter issues, try to submit all work to the GPU, and waiting
1212+
/// for that work to finish before stopping the capture.
1213+
///
1214+
/// [rd]: https://renderdoc.org/docs/in_application_api.html#_CPPv415EndFrameCapture23RENDERDOC_DevicePointer22RENDERDOC_WindowHandle
1215+
/// [xcode]: https://developer.apple.com/documentation/metal/mtlcapturemanager
1216+
</span><span class="attr">#[doc(alias = <span class="string">"stop_renderdoc_capture"</span>)]
1217+
#[doc(alias = <span class="string">"stop_xcode_capture"</span>)]
1218+
</span><span class="kw">pub unsafe fn </span>stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1219+
<span class="kw">unsafe </span>{ <span class="self">self</span>.inner.stop_graphics_debugger_capture() }
11181220
}
11191221

11201222
<span class="doccomment">/// Query internal counters from the native backend for debugging purposes.

doc/src/wgpu/backend/wgpu_core.rs.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3623,7 +3623,15 @@
36233623
<a href="#3622" id="3622">3622</a>
36243624
<a href="#3623" id="3623">3623</a>
36253625
<a href="#3624" id="3624">3624</a>
3626-
<a href="#3625" id="3625">3625</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3626+
<a href="#3625" id="3625">3625</a>
3627+
<a href="#3626" id="3626">3626</a>
3628+
<a href="#3627" id="3627">3627</a>
3629+
<a href="#3628" id="3628">3628</a>
3630+
<a href="#3629" id="3629">3629</a>
3631+
<a href="#3630" id="3630">3630</a>
3632+
<a href="#3631" id="3631">3631</a>
3633+
<a href="#3632" id="3632">3632</a>
3634+
<a href="#3633" id="3633">3633</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
36273635
borrow::Cow::Borrowed,
36283636
boxed::Box,
36293637
format,
@@ -5271,12 +5279,20 @@
52715279
Box::pin(ready(scope.error))
52725280
}
52735281

5274-
<span class="kw">fn </span>start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5275-
<span class="self">self</span>.context.<span class="number">0</span>.device_start_capture(<span class="self">self</span>.id);
5282+
<span class="kw">unsafe fn </span>start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5283+
<span class="kw">unsafe </span>{
5284+
<span class="self">self</span>.context
5285+
.<span class="number">0
5286+
</span>.device_start_graphics_debugger_capture(<span class="self">self</span>.id)
5287+
};
52765288
}
52775289

5278-
<span class="kw">fn </span>stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5279-
<span class="self">self</span>.context.<span class="number">0</span>.device_stop_capture(<span class="self">self</span>.id);
5290+
<span class="kw">unsafe fn </span>stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5291+
<span class="kw">unsafe </span>{
5292+
<span class="self">self</span>.context
5293+
.<span class="number">0
5294+
</span>.device_stop_graphics_debugger_capture(<span class="self">self</span>.id)
5295+
};
52805296
}
52815297

52825298
<span class="kw">fn </span>poll(<span class="kw-2">&amp;</span><span class="self">self</span>, poll_type: <span class="kw">crate</span>::PollType) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="kw">crate</span>::PollStatus, <span class="kw">crate</span>::PollError&gt; {

doc/src/wgpu/dispatch.rs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,8 @@
978978
<span class="kw">fn </span>push_error_scope(<span class="kw-2">&amp;</span><span class="self">self</span>, filter: <span class="kw">crate</span>::ErrorFilter);
979979
<span class="kw">fn </span>pop_error_scope(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; Pin&lt;Box&lt;<span class="kw">dyn </span>PopErrorScopeFuture&gt;&gt;;
980980

981-
<span class="kw">fn </span>start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
982-
<span class="kw">fn </span>stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
981+
<span class="kw">unsafe fn </span>start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
982+
<span class="kw">unsafe fn </span>stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
983983

984984
<span class="kw">fn </span>poll(<span class="kw-2">&amp;</span><span class="self">self</span>, poll_type: <span class="kw">crate</span>::PollType) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="kw">crate</span>::PollStatus, <span class="kw">crate</span>::PollError&gt;;
985985

doc/src/wgpu_core/device/global.rs.html

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,17 @@
22682268
<a href="#2267" id="2267">2267</a>
22692269
<a href="#2268" id="2268">2268</a>
22702270
<a href="#2269" id="2269">2269</a>
2271-
<a href="#2270" id="2270">2270</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc, vec::Vec};
2271+
<a href="#2270" id="2270">2270</a>
2272+
<a href="#2271" id="2271">2271</a>
2273+
<a href="#2272" id="2272">2272</a>
2274+
<a href="#2273" id="2273">2273</a>
2275+
<a href="#2274" id="2274">2274</a>
2276+
<a href="#2275" id="2275">2275</a>
2277+
<a href="#2276" id="2276">2276</a>
2278+
<a href="#2277" id="2277">2277</a>
2279+
<a href="#2278" id="2278">2278</a>
2280+
<a href="#2279" id="2279">2279</a>
2281+
<a href="#2280" id="2280">2280</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc, vec::Vec};
22722282
<span class="kw">use </span>core::{ptr::NonNull, sync::atomic::Ordering};
22732283

22742284
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
@@ -4295,26 +4305,36 @@
42954305
<span class="prelude-val">Ok</span>(all_queue_empty)
42964306
}
42974307

4298-
<span class="kw">pub fn </span>device_start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>, device_id: DeviceId) {
4299-
<span class="macro">api_log!</span>(<span class="string">"Device::start_capture"</span>);
4308+
<span class="doccomment">/// # Safety
4309+
///
4310+
/// - See [wgpu::Device::start_graphics_debugger_capture][api] for details the safety.
4311+
///
4312+
/// [api]: ../../wgpu/struct.Device.html#method.start_graphics_debugger_capture
4313+
</span><span class="kw">pub unsafe fn </span>device_start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>, device_id: DeviceId) {
4314+
<span class="macro">api_log!</span>(<span class="string">"Device::start_graphics_debugger_capture"</span>);
43004315

43014316
<span class="kw">let </span>device = <span class="self">self</span>.hub.devices.get(device_id);
43024317

43034318
<span class="kw">if </span>!device.is_valid() {
43044319
<span class="kw">return</span>;
43054320
}
4306-
<span class="kw">unsafe </span>{ device.raw().start_capture() };
4321+
<span class="kw">unsafe </span>{ device.raw().start_graphics_debugger_capture() };
43074322
}
43084323

4309-
<span class="kw">pub fn </span>device_stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>, device_id: DeviceId) {
4310-
<span class="macro">api_log!</span>(<span class="string">"Device::stop_capture"</span>);
4324+
<span class="doccomment">/// # Safety
4325+
///
4326+
/// - See [wgpu::Device::stop_graphics_debugger_capture][api] for details the safety.
4327+
///
4328+
/// [api]: ../../wgpu/struct.Device.html#method.stop_graphics_debugger_capture
4329+
</span><span class="kw">pub unsafe fn </span>device_stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>, device_id: DeviceId) {
4330+
<span class="macro">api_log!</span>(<span class="string">"Device::stop_graphics_debugger_capture"</span>);
43114331

43124332
<span class="kw">let </span>device = <span class="self">self</span>.hub.devices.get(device_id);
43134333

43144334
<span class="kw">if </span>!device.is_valid() {
43154335
<span class="kw">return</span>;
43164336
}
4317-
<span class="kw">unsafe </span>{ device.raw().stop_capture() };
4337+
<span class="kw">unsafe </span>{ device.raw().stop_graphics_debugger_capture() };
43184338
}
43194339

43204340
<span class="kw">pub fn </span>pipeline_cache_get_data(<span class="kw-2">&amp;</span><span class="self">self</span>, id: id::PipelineCacheId) -&gt; <span class="prelude-ty">Option</span>&lt;Vec&lt;u8&gt;&gt; {

doc/src/wgpu_hal/dynamic/device.rs.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,8 @@
712712
timeout_ms: u32,
713713
) -&gt; <span class="prelude-ty">Result</span>&lt;bool, DeviceError&gt;;
714714

715-
<span class="kw">unsafe fn </span>start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool;
716-
<span class="kw">unsafe fn </span>stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
715+
<span class="kw">unsafe fn </span>start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool;
716+
<span class="kw">unsafe fn </span>stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>);
717717

718718
<span class="kw">unsafe fn </span>pipeline_cache_get_data(<span class="kw-2">&amp;</span><span class="self">self</span>, cache: <span class="kw-2">&amp;</span><span class="kw">dyn </span>DynPipelineCache) -&gt; <span class="prelude-ty">Option</span>&lt;Vec&lt;u8&gt;&gt;;
719719

@@ -1070,12 +1070,12 @@
10701070
<span class="kw">unsafe </span>{ D::wait(<span class="self">self</span>, fence, value, timeout_ms) }
10711071
}
10721072

1073-
<span class="kw">unsafe fn </span>start_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
1074-
<span class="kw">unsafe </span>{ D::start_capture(<span class="self">self</span>) }
1073+
<span class="kw">unsafe fn </span>start_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; bool {
1074+
<span class="kw">unsafe </span>{ D::start_graphics_debugger_capture(<span class="self">self</span>) }
10751075
}
10761076

1077-
<span class="kw">unsafe fn </span>stop_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1078-
<span class="kw">unsafe </span>{ D::stop_capture(<span class="self">self</span>) }
1077+
<span class="kw">unsafe fn </span>stop_graphics_debugger_capture(<span class="kw-2">&amp;</span><span class="self">self</span>) {
1078+
<span class="kw">unsafe </span>{ D::stop_graphics_debugger_capture(<span class="self">self</span>) }
10791079
}
10801080

10811081
<span class="kw">unsafe fn </span>pipeline_cache_get_data(<span class="kw-2">&amp;</span><span class="self">self</span>, cache: <span class="kw-2">&amp;</span><span class="kw">dyn </span>DynPipelineCache) -&gt; <span class="prelude-ty">Option</span>&lt;Vec&lt;u8&gt;&gt; {

0 commit comments

Comments
 (0)