|
3671 | 3671 | <span id="3669">3669</span>
|
3672 | 3672 | <span id="3670">3670</span>
|
3673 | 3673 | <span id="3671">3671</span>
|
| 3674 | +<span id="3672">3672</span> |
| 3675 | +<span id="3673">3673</span> |
| 3676 | +<span id="3674">3674</span> |
| 3677 | +<span id="3675">3675</span> |
| 3678 | +<span id="3676">3676</span> |
| 3679 | +<span id="3677">3677</span> |
| 3680 | +<span id="3678">3678</span> |
| 3681 | +<span id="3679">3679</span> |
| 3682 | +<span id="3680">3680</span> |
| 3683 | +<span id="3681">3681</span> |
| 3684 | +<span id="3682">3682</span> |
| 3685 | +<span id="3683">3683</span> |
| 3686 | +<span id="3684">3684</span> |
| 3687 | +<span id="3685">3685</span> |
| 3688 | +<span id="3686">3686</span> |
| 3689 | +<span id="3687">3687</span> |
| 3690 | +<span id="3688">3688</span> |
| 3691 | +<span id="3689">3689</span> |
| 3692 | +<span id="3690">3690</span> |
| 3693 | +<span id="3691">3691</span> |
| 3694 | +<span id="3692">3692</span> |
| 3695 | +<span id="3693">3693</span> |
| 3696 | +<span id="3694">3694</span> |
| 3697 | +<span id="3695">3695</span> |
| 3698 | +<span id="3696">3696</span> |
| 3699 | +<span id="3697">3697</span> |
3674 | 3700 | </pre><pre class="rust"><code><span class="doccomment">//! A cross-platform graphics and compute library based on [WebGPU](https://gpuweb.github.io/gpuweb/).
|
3675 | 3701 | //!
|
3676 | 3702 | //! To start using the API, create an [`Instance`].
|
|
5589 | 5615 | })
|
5590 | 5616 | }
|
5591 | 5617 |
|
5592 |
| - <span class="doccomment">/// Returns the inner hal Adapter using a callback. The hal adapter will be `None` if the |
5593 |
| - /// backend type argument does not match with this wgpu Adapter |
| 5618 | + <span class="doccomment">/// Apply a callback to this `Adapter`'s underlying backend adapter. |
| 5619 | + /// |
| 5620 | + /// If this `Adapter` is implemented by the backend API given by `A` (Vulkan, |
| 5621 | + /// Dx12, etc.), then apply `hal_adapter_callback` to `Some(&adapter)`, where |
| 5622 | + /// `adapter` is the underlying backend adapter type, [`A::Adapter`]. |
| 5623 | + /// |
| 5624 | + /// If this `Adapter` uses a different backend, apply `hal_adapter_callback` |
| 5625 | + /// to `None`. |
| 5626 | + /// |
| 5627 | + /// The adapter is locked for reading while `hal_adapter_callback` runs. If |
| 5628 | + /// the callback attempts to perform any `wgpu` operations that require |
| 5629 | + /// write access to the adapter, deadlock will occur. The locks are |
| 5630 | + /// automatically released when the callback returns. |
5594 | 5631 | ///
|
5595 | 5632 | /// # Safety
|
5596 | 5633 | ///
|
5597 |
| - /// - The raw handle obtained from the hal Adapter must not be manually destroyed |
| 5634 | + /// - The raw handle passed to the callback must not be manually destroyed. |
| 5635 | + /// |
| 5636 | + /// [`A::Adapter`]: hal::Api::Adapter |
5598 | 5637 | </span><span class="attribute">#[cfg(any(not(target_arch = <span class="string">"wasm32"</span>), feature = <span class="string">"webgl"</span>))]
|
5599 | 5638 | </span><span class="kw">pub unsafe fn </span>as_hal<A: wgc::hub::HalApi, F: FnOnce(<span class="prelude-ty">Option</span><<span class="kw-2">&</span>A::Adapter>) -> R, R>(
|
5600 | 5639 | <span class="kw-2">&</span><span class="self">self</span>,
|
|
5884 | 5923 | Context::device_stop_capture(<span class="kw-2">&*</span><span class="self">self</span>.context, <span class="kw-2">&</span><span class="self">self</span>.id)
|
5885 | 5924 | }
|
5886 | 5925 |
|
5887 |
| - <span class="doccomment">/// Returns the inner hal Device using a callback. The hal device will be `None` if the |
5888 |
| - /// backend type argument does not match with this wgpu Device |
| 5926 | + <span class="doccomment">/// Apply a callback to this `Device`'s underlying backend device. |
| 5927 | + /// |
| 5928 | + /// If this `Device` is implemented by the backend API given by `A` (Vulkan, |
| 5929 | + /// Dx12, etc.), then apply `hal_device_callback` to `Some(&device)`, where |
| 5930 | + /// `device` is the underlying backend device type, [`A::Device`]. |
| 5931 | + /// |
| 5932 | + /// If this `Device` uses a different backend, apply `hal_device_callback` |
| 5933 | + /// to `None`. |
| 5934 | + /// |
| 5935 | + /// The device is locked for reading while `hal_device_callback` runs. If |
| 5936 | + /// the callback attempts to perform any `wgpu` operations that require |
| 5937 | + /// write access to the device (destroying a buffer, say), deadlock will |
| 5938 | + /// occur. The locks are automatically released when the callback returns. |
5889 | 5939 | ///
|
5890 | 5940 | /// # Safety
|
5891 | 5941 | ///
|
5892 |
| - /// - The raw handle obtained from the hal Device must not be manually destroyed |
| 5942 | + /// - The raw handle passed to the callback must not be manually destroyed. |
| 5943 | + /// |
| 5944 | + /// [`A::Device`]: hal::Api::Device |
5893 | 5945 | </span><span class="attribute">#[cfg(any(not(target_arch = <span class="string">"wasm32"</span>), feature = <span class="string">"emscripten"</span>))]
|
5894 | 5946 | </span><span class="kw">pub unsafe fn </span>as_hal<A: wgc::hub::HalApi, F: FnOnce(<span class="prelude-ty">Option</span><<span class="kw-2">&</span>A::Device>) -> R, R>(
|
5895 | 5947 | <span class="kw-2">&</span><span class="self">self</span>,
|
|
0 commit comments