Skip to content

Commit 32c86e4

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@24d0eae 🚀
1 parent 8618ce2 commit 32c86e4

File tree

124 files changed

+304
-337
lines changed

Some content is hidden

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

124 files changed

+304
-337
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_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/player/lib.rs.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@
715715
}
716716
}
717717
Action::FreeBuffer(id) => {
718-
<span class="self">self</span>.buffer_destroy(id).unwrap();
718+
<span class="self">self</span>.buffer_destroy(id);
719719
}
720720
Action::DestroyBuffer(id) =&gt; {
721721
<span class="self">self</span>.buffer_drop(id);
@@ -727,7 +727,7 @@
727727
}
728728
}
729729
Action::FreeTexture(id) =&gt; {
730-
<span class="self">self</span>.texture_destroy(id).unwrap();
730+
<span class="self">self</span>.texture_destroy(id);
731731
}
732732
Action::DestroyTexture(id) =&gt; {
733733
<span class="self">self</span>.texture_drop(id);

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3706,9 +3706,7 @@
37063706
<a href="#3705" id="3705">3705</a>
37073707
<a href="#3706" id="3706">3706</a>
37083708
<a href="#3707" id="3707">3707</a>
3709-
<a href="#3708" id="3708">3708</a>
3710-
<a href="#3709" id="3709">3709</a>
3711-
<a href="#3710" id="3710">3710</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3709+
<a href="#3708" id="3708">3708</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
37123710
borrow::Cow::{<span class="self">self</span>, Borrowed},
37133711
boxed::Box,
37143712
format,
@@ -5766,8 +5764,7 @@
57665764
}
57675765

57685766
<span class="kw">fn </span>destroy(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5769-
<span class="comment">// Per spec, no error to report. Even calling destroy multiple times is valid.
5770-
</span><span class="kw">let _ </span>= <span class="self">self</span>.context.<span class="number">0</span>.buffer_destroy(<span class="self">self</span>.id);
5767+
<span class="self">self</span>.context.<span class="number">0</span>.buffer_destroy(<span class="self">self</span>.id);
57715768
}
57725769
}
57735770

@@ -5811,8 +5808,7 @@
58115808
}
58125809

58135810
<span class="kw">fn </span>destroy(<span class="kw-2">&amp;</span><span class="self">self</span>) {
5814-
<span class="comment">// Per spec, no error to report. Even calling destroy multiple times is valid.
5815-
</span><span class="kw">let _ </span>= <span class="self">self</span>.context.<span class="number">0</span>.texture_destroy(<span class="self">self</span>.id);
5811+
<span class="self">self</span>.context.<span class="number">0</span>.texture_destroy(<span class="self">self</span>.id);
58165812
}
58175813
}
58185814

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

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,13 @@
22932293
<a href="#2292" id="2292">2292</a>
22942294
<a href="#2293" id="2293">2293</a>
22952295
<a href="#2294" id="2294">2294</a>
2296-
<a href="#2295" id="2295">2295</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc, vec::Vec};
2296+
<a href="#2295" id="2295">2295</a>
2297+
<a href="#2296" id="2296">2296</a>
2298+
<a href="#2297" id="2297">2297</a>
2299+
<a href="#2298" id="2298">2298</a>
2300+
<a href="#2299" id="2299">2299</a>
2301+
<a href="#2300" id="2300">2300</a>
2302+
<a href="#2301" id="2301">2301</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc, vec::Vec};
22972303
<span class="kw">use </span>core::{ptr::NonNull, sync::atomic::Ordering};
22982304

22992305
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
@@ -2547,13 +2553,16 @@
25472553
<span class="prelude-val">Ok</span>(())
25482554
}
25492555

2550-
<span class="kw">pub fn </span>buffer_destroy(<span class="kw-2">&amp;</span><span class="self">self</span>, buffer_id: id::BufferId) -&gt; <span class="prelude-ty">Result</span>&lt;(), resource::DestroyError&gt; {
2556+
<span class="kw">pub fn </span>buffer_destroy(<span class="kw-2">&amp;</span><span class="self">self</span>, buffer_id: id::BufferId) {
25512557
<span class="macro">profiling::scope!</span>(<span class="string">"Buffer::destroy"</span>);
25522558
<span class="macro">api_log!</span>(<span class="string">"Buffer::destroy {buffer_id:?}"</span>);
25532559

25542560
<span class="kw">let </span>hub = <span class="kw-2">&amp;</span><span class="self">self</span>.hub;
25552561

2556-
<span class="kw">let </span>buffer = hub.buffers.get(buffer_id).get()<span class="question-mark">?</span>;
2562+
<span class="kw">let </span><span class="prelude-val">Ok</span>(buffer) = hub.buffers.get(buffer_id).get() <span class="kw">else </span>{
2563+
<span class="comment">// If the buffer is already invalid, there's nothing to do.
2564+
</span><span class="kw">return</span>;
2565+
};
25572566

25582567
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
25592568
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(trace) = buffer.device.trace.lock().as_mut() {
@@ -2565,7 +2574,7 @@
25652574
</span>buffer_id,
25662575
);
25672576

2568-
buffer.destroy()
2577+
buffer.destroy();
25692578
}
25702579

25712580
<span class="kw">pub fn </span>buffer_drop(<span class="kw-2">&amp;</span><span class="self">self</span>, buffer_id: id::BufferId) {
@@ -2704,20 +2713,23 @@
27042713
(id, err)
27052714
}
27062715

2707-
<span class="kw">pub fn </span>texture_destroy(<span class="kw-2">&amp;</span><span class="self">self</span>, texture_id: id::TextureId) -&gt; <span class="prelude-ty">Result</span>&lt;(), resource::DestroyError&gt; {
2716+
<span class="kw">pub fn </span>texture_destroy(<span class="kw-2">&amp;</span><span class="self">self</span>, texture_id: id::TextureId) {
27082717
<span class="macro">profiling::scope!</span>(<span class="string">"Texture::destroy"</span>);
27092718
<span class="macro">api_log!</span>(<span class="string">"Texture::destroy {texture_id:?}"</span>);
27102719

27112720
<span class="kw">let </span>hub = <span class="kw-2">&amp;</span><span class="self">self</span>.hub;
27122721

2713-
<span class="kw">let </span>texture = hub.textures.get(texture_id).get()<span class="question-mark">?</span>;
2722+
<span class="kw">let </span><span class="prelude-val">Ok</span>(texture) = hub.textures.get(texture_id).get() <span class="kw">else </span>{
2723+
<span class="comment">// If the texture is already invalid, there's nothing to do.
2724+
</span><span class="kw">return</span>;
2725+
};
27142726

27152727
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
27162728
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(trace) = texture.device.trace.lock().as_mut() {
27172729
trace.add(trace::Action::FreeTexture(texture_id));
27182730
}
27192731

2720-
texture.destroy()
2732+
texture.destroy();
27212733
}
27222734

27232735
<span class="kw">pub fn </span>texture_drop(<span class="kw-2">&amp;</span><span class="self">self</span>, texture_id: id::TextureId) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7856,12 +7856,12 @@
78567856
</span><span class="kw">let </span>trackers = <span class="self">self</span>.trackers.lock();
78577857
<span class="kw">for </span>buffer <span class="kw">in </span>trackers.buffers.used_resources() {
78587858
<span class="kw">if let </span><span class="prelude-val">Some</span>(buffer) = Weak::upgrade(buffer) {
7859-
<span class="kw">let _ </span>= buffer.destroy();
7859+
buffer.destroy();
78607860
}
78617861
}
78627862
<span class="kw">for </span>texture <span class="kw">in </span>trackers.textures.used_resources() {
78637863
<span class="kw">if let </span><span class="prelude-val">Some</span>(texture) = Weak::upgrade(texture) {
7864-
<span class="kw">let _ </span>= texture.destroy();
7864+
texture.destroy();
78657865
}
78667866
}
78677867
}

doc/src/wgpu_core/resource.rs.html

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,18 +2065,7 @@
20652065
<a href="#2064" id="2064">2064</a>
20662066
<a href="#2065" id="2065">2065</a>
20672067
<a href="#2066" id="2066">2066</a>
2068-
<a href="#2067" id="2067">2067</a>
2069-
<a href="#2068" id="2068">2068</a>
2070-
<a href="#2069" id="2069">2069</a>
2071-
<a href="#2070" id="2070">2070</a>
2072-
<a href="#2071" id="2071">2071</a>
2073-
<a href="#2072" id="2072">2072</a>
2074-
<a href="#2073" id="2073">2073</a>
2075-
<a href="#2074" id="2074">2074</a>
2076-
<a href="#2075" id="2075">2075</a>
2077-
<a href="#2076" id="2076">2076</a>
2078-
<a href="#2077" id="2077">2077</a>
2079-
<a href="#2078" id="2078">2078</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, borrow::ToOwned <span class="kw">as _</span>, boxed::Box, string::String, sync::Arc, vec::Vec};
2068+
<a href="#2067" id="2067">2067</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, borrow::ToOwned <span class="kw">as _</span>, boxed::Box, string::String, sync::Arc, vec::Vec};
20802069
<span class="kw">use </span>core::{
20812070
borrow::Borrow,
20822071
fmt,
@@ -2782,7 +2771,7 @@
27822771
<span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>)
27832772
}
27842773

2785-
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>destroy(<span class="self">self</span>: <span class="kw-2">&amp;</span>Arc&lt;<span class="self">Self</span>&gt;) -&gt; <span class="prelude-ty">Result</span>&lt;(), DestroyError&gt; {
2774+
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>destroy(<span class="self">self</span>: <span class="kw-2">&amp;</span>Arc&lt;<span class="self">Self</span>&gt;) {
27862775
<span class="kw">let </span>device = <span class="kw-2">&amp;</span><span class="self">self</span>.device;
27872776

27882777
<span class="kw">let </span>temp = {
@@ -2792,7 +2781,7 @@
27922781
<span class="prelude-val">Some</span>(raw) =&gt; raw,
27932782
<span class="prelude-val">None </span>=&gt; {
27942783
<span class="comment">// Per spec, it is valid to call `destroy` multiple times.
2795-
</span><span class="kw">return </span><span class="prelude-val">Ok</span>(());
2784+
</span><span class="kw">return</span>;
27962785
}
27972786
};
27982787

@@ -2833,8 +2822,6 @@
28332822
}
28342823
}
28352824
}
2836-
2837-
<span class="prelude-val">Ok</span>(())
28382825
}
28392826
}
28402827

@@ -3258,18 +3245,18 @@
32583245
}
32593246
}
32603247

3261-
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>destroy(<span class="self">self</span>: <span class="kw-2">&amp;</span>Arc&lt;<span class="self">Self</span>&gt;) -&gt; <span class="prelude-ty">Result</span>&lt;(), DestroyError&gt; {
3248+
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>destroy(<span class="self">self</span>: <span class="kw-2">&amp;</span>Arc&lt;<span class="self">Self</span>&gt;) {
32623249
<span class="kw">let </span>device = <span class="kw-2">&amp;</span><span class="self">self</span>.device;
32633250

32643251
<span class="kw">let </span>temp = {
32653252
<span class="kw">let </span>raw = <span class="kw">match </span><span class="self">self</span>.inner.snatch(<span class="kw-2">&amp;mut </span>device.snatchable_lock.write()) {
32663253
<span class="prelude-val">Some</span>(TextureInner::Native { raw }) =&gt; raw,
32673254
<span class="prelude-val">Some</span>(TextureInner::Surface { .. }) =&gt; {
3268-
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
3255+
<span class="kw">return</span>;
32693256
}
32703257
<span class="prelude-val">None </span>=&gt; {
32713258
<span class="comment">// Per spec, it is valid to call `destroy` multiple times.
3272-
</span><span class="kw">return </span><span class="prelude-val">Ok</span>(());
3259+
</span><span class="kw">return</span>;
32733260
}
32743261
};
32753262

@@ -3305,8 +3292,6 @@
33053292
}
33063293
}
33073294
}
3308-
3309-
<span class="prelude-val">Ok</span>(())
33103295
}
33113296
}
33123297

@@ -4046,13 +4031,6 @@
40464031
}
40474032
}
40484033

4049-
<span class="attr">#[derive(Clone, Debug, Error)]
4050-
#[non_exhaustive]
4051-
</span><span class="kw">pub enum </span>DestroyError {
4052-
<span class="attr">#[error(transparent)]
4053-
</span>InvalidResource(<span class="attr">#[from] </span>InvalidResourceError),
4054-
}
4055-
40564034
<span class="kw">pub type </span>BlasDescriptor&lt;<span class="lifetime">'a</span>&gt; = wgt::CreateBlasDescriptor&lt;Label&lt;<span class="lifetime">'a</span>&gt;&gt;;
40574035
<span class="kw">pub type </span>TlasDescriptor&lt;<span class="lifetime">'a</span>&gt; = wgt::CreateTlasDescriptor&lt;Label&lt;<span class="lifetime">'a</span>&gt;&gt;;
40584036

doc/trait.impl/core/clone/trait.Clone.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/trait.impl/core/convert/trait.From.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/trait.impl/core/error/trait.Error.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.

0 commit comments

Comments
 (0)