Skip to content

Commit f973e70

Browse files
committed
Deploying to master from @ bec26b79ec27b98838f589eff4d20c4b86780be9 🚀
1 parent 3e565c9 commit f973e70

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
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/src/wgpu/backend/direct.rs.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,11 +2481,11 @@
24812481
))
24822482
}
24832483

2484-
<span class="kw">pub unsafe fn </span>instance_as_hal&lt;A: wgc::hub::HalApi, F: FnOnce(<span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>A::Instance&gt;) -&gt; R, R&gt;(
2485-
<span class="kw-2">&amp;</span><span class="self">self</span>,
2486-
hal_instance_callback: F,
2487-
) -&gt; R {
2488-
<span class="self">self</span>.<span class="number">0</span>.instance_as_hal::&lt;A, F, R&gt;(hal_instance_callback)
2484+
<span class="doccomment">/// # Safety
2485+
///
2486+
/// - The raw instance handle returned must not be manually destroyed.
2487+
</span><span class="kw">pub unsafe fn </span>instance_as_hal&lt;A: wgc::hub::HalApi&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>A::Instance&gt; {
2488+
<span class="self">self</span>.<span class="number">0</span>.instance_as_hal::&lt;A&gt;()
24892489
}
24902490

24912491
<span class="kw">pub unsafe fn </span>from_core_instance(core_instance: wgc::instance::Instance) -&gt; <span class="self">Self </span>{

‎doc/src/wgpu/lib.rs.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5344,19 +5344,19 @@
53445344
}
53455345
}
53465346

5347-
<span class="doccomment">/// Returns the inner hal Instance using a callback. The hal instance will be `None` if the
5348-
/// backend type argument does not match with this wgpu Instance
5347+
<span class="doccomment">/// Return a reference to a specific backend instance, if available.
5348+
///
5349+
/// If this `Instance` has a wgpu-hal [`Instance`] for backend
5350+
/// `A`, return a reference to it. Otherwise, return `None`.
53495351
///
53505352
/// # Safety
53515353
///
5352-
/// - The raw handle obtained from the hal Instance must not be manually destroyed
5354+
/// - The raw instance handle returned must not be manually destroyed.
5355+
///
5356+
/// [`Instance`]: hal::Api::Instance
53535357
</span><span class="attribute">#[cfg(any(not(target_arch = <span class="string">&quot;wasm32&quot;</span>), feature = <span class="string">&quot;webgl&quot;</span>))]
5354-
</span><span class="kw">pub unsafe fn </span>as_hal&lt;A: wgc::hub::HalApi, F: FnOnce(<span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>A::Instance&gt;) -&gt; R, R&gt;(
5355-
<span class="kw-2">&amp;</span><span class="self">self</span>,
5356-
hal_instance_callback: F,
5357-
) -&gt; R {
5358-
<span class="self">self</span>.context
5359-
.instance_as_hal::&lt;A, F, R&gt;(hal_instance_callback)
5358+
</span><span class="kw">pub unsafe fn </span>as_hal&lt;A: wgc::hub::HalApi&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>A::Instance&gt; {
5359+
<span class="self">self</span>.context.instance_as_hal::&lt;A&gt;()
53605360
}
53615361

53625362
<span class="doccomment">/// Create an new instance of wgpu from a wgpu-core instance.

‎doc/wgpu/struct.Instance.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ <h5 id="arguments-1"><a href="#arguments-1">Arguments</a></h5>
1818
</ul>
1919
<h5 id="safety"><a href="#safety">Safety</a></h5>
2020
<p>Refer to the creation of wgpu-hal Instance for every backend.</p>
21-
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_hal" class="method has-srclink"><a class="srclink rightside" href="../src/wgpu/lib.rs.html#1681-1687">source</a><h4 class="code-header">pub unsafe fn <a href="#method.as_hal" class="fnname">as_hal</a>&lt;A:&nbsp;HalApi, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;A::<a class="associatedtype" href="../wgpu_hal/trait.Api.html#associatedtype.Instance" title="type wgpu_hal::Api::Instance">Instance</a>&gt;) -&gt; R, R&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;hal_instance_callback: F<br>) -&gt; R</h4></section></summary><div class="docblock"><p>Returns the inner hal Instance using a callback. The hal instance will be <code>None</code> if the
22-
backend type argument does not match with this wgpu Instance</p>
21+
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.as_hal" class="method has-srclink"><a class="srclink rightside" href="../src/wgpu/lib.rs.html#1685-1687">source</a><h4 class="code-header">pub unsafe fn <a href="#method.as_hal" class="fnname">as_hal</a>&lt;A:&nbsp;HalApi&gt;(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;A::<a class="associatedtype" href="../wgpu_hal/trait.Api.html#associatedtype.Instance" title="type wgpu_hal::Api::Instance">Instance</a>&gt;</h4></section></summary><div class="docblock"><p>Return a reference to a specific backend instance, if available.</p>
22+
<p>If this <code>Instance</code> has a wgpu-hal <a href="../wgpu_hal/trait.Api.html#associatedtype.Instance"><code>Instance</code></a> for backend
23+
<code>A</code>, return a reference to it. Otherwise, return <code>None</code>.</p>
2324
<h5 id="safety-1"><a href="#safety-1">Safety</a></h5>
2425
<ul>
25-
<li>The raw handle obtained from the hal Instance must not be manually destroyed</li>
26+
<li>The raw instance handle returned must not be manually destroyed.</li>
2627
</ul>
2728
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_core" class="method has-srclink"><a class="srclink rightside" href="../src/wgpu/lib.rs.html#1699-1703">source</a><h4 class="code-header">pub unsafe fn <a href="#method.from_core" class="fnname">from_core</a>(core_instance: Instance) -&gt; Self</h4></section></summary><div class="docblock"><p>Create an new instance of wgpu from a wgpu-core instance.</p>
2829
<h5 id="arguments-2"><a href="#arguments-2">Arguments</a></h5>

0 commit comments

Comments
 (0)