Skip to content

Commit c80ca35

Browse files
committed
Deploying to master from @ gfx-rs/wgpu@1fdd05a 🚀
1 parent c1f1314 commit c80ca35

File tree

365 files changed

+2248
-1547
lines changed

Some content is hidden

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

365 files changed

+2248
-1547
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/search.desc/wgpu_types/wgpu_types-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/backend/wgpu_core.rs.html

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3678,7 +3678,36 @@
36783678
<a href="#3677" id="3677">3677</a>
36793679
<a href="#3678" id="3678">3678</a>
36803680
<a href="#3679" id="3679">3679</a>
3681-
<a href="#3680" id="3680">3680</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3681+
<a href="#3680" id="3680">3680</a>
3682+
<a href="#3681" id="3681">3681</a>
3683+
<a href="#3682" id="3682">3682</a>
3684+
<a href="#3683" id="3683">3683</a>
3685+
<a href="#3684" id="3684">3684</a>
3686+
<a href="#3685" id="3685">3685</a>
3687+
<a href="#3686" id="3686">3686</a>
3688+
<a href="#3687" id="3687">3687</a>
3689+
<a href="#3688" id="3688">3688</a>
3690+
<a href="#3689" id="3689">3689</a>
3691+
<a href="#3690" id="3690">3690</a>
3692+
<a href="#3691" id="3691">3691</a>
3693+
<a href="#3692" id="3692">3692</a>
3694+
<a href="#3693" id="3693">3693</a>
3695+
<a href="#3694" id="3694">3694</a>
3696+
<a href="#3695" id="3695">3695</a>
3697+
<a href="#3696" id="3696">3696</a>
3698+
<a href="#3697" id="3697">3697</a>
3699+
<a href="#3698" id="3698">3698</a>
3700+
<a href="#3699" id="3699">3699</a>
3701+
<a href="#3700" id="3700">3700</a>
3702+
<a href="#3701" id="3701">3701</a>
3703+
<a href="#3702" id="3702">3702</a>
3704+
<a href="#3703" id="3703">3703</a>
3705+
<a href="#3704" id="3704">3704</a>
3706+
<a href="#3705" id="3705">3705</a>
3707+
<a href="#3706" id="3706">3706</a>
3708+
<a href="#3707" id="3707">3707</a>
3709+
<a href="#3708" id="3708">3708</a>
3710+
<a href="#3709" id="3709">3709</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
36823711
borrow::Cow::{<span class="self">self</span>, Borrowed},
36833712
boxed::Box,
36843713
format,
@@ -4001,6 +4030,35 @@
40014030
source: source_error,
40024031
};
40034032
}
4033+
<span class="kw">let </span>device_error =
4034+
<span class="kw">if let </span><span class="prelude-val">Some</span>(wgc::resource::CreateTextureError::Device(device_error)) =
4035+
source.downcast_ref::&lt;wgc::resource::CreateTextureError&gt;()
4036+
{
4037+
<span class="prelude-val">Some</span>(device_error)
4038+
} <span class="kw">else if let </span><span class="prelude-val">Some</span>(wgc::resource::CreateBufferError::Device(device_error)) =
4039+
source.downcast_ref::&lt;wgc::resource::CreateBufferError&gt;()
4040+
{
4041+
<span class="prelude-val">Some</span>(device_error)
4042+
} <span class="kw">else if let </span><span class="prelude-val">Some</span>(wgc::resource::CreateQuerySetError::Device(device_error)) =
4043+
source.downcast_ref::&lt;wgc::resource::CreateQuerySetError&gt;()
4044+
{
4045+
<span class="prelude-val">Some</span>(device_error)
4046+
} <span class="kw">else if let </span><span class="prelude-val">Some</span>(wgc::ray_tracing::CreateBlasError::Device(device_error)) =
4047+
source.downcast_ref::&lt;wgc::ray_tracing::CreateBlasError&gt;()
4048+
{
4049+
<span class="prelude-val">Some</span>(device_error)
4050+
} <span class="kw">else if let </span><span class="prelude-val">Some</span>(wgc::ray_tracing::CreateTlasError::Device(device_error)) =
4051+
source.downcast_ref::&lt;wgc::ray_tracing::CreateTlasError&gt;()
4052+
{
4053+
<span class="prelude-val">Some</span>(device_error)
4054+
} <span class="kw">else </span>{
4055+
<span class="prelude-val">None
4056+
</span>};
4057+
<span class="kw">if let </span><span class="prelude-val">Some</span>(wgc::device::DeviceError::OutOfMemory) = device_error {
4058+
<span class="kw">break </span><span class="kw">crate</span>::Error::OutOfMemory {
4059+
source: source_error,
4060+
};
4061+
}
40044062
source_opt = source.source();
40054063
} <span class="kw">else </span>{
40064064
<span class="comment">// Otherwise, it is a validation error

doc/src/wgpu/lib.rs.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,17 @@
203203
Dx12BackendOptions, Dx12Compiler, DxcShaderModel, DynamicOffset, Extent3d, Face, Features,
204204
FeaturesWGPU, FeaturesWebGPU, FilterMode, FrontFace, GlBackendOptions, GlFenceBehavior,
205205
Gles3MinorVersion, HalCounters, ImageSubresourceRange, IndexFormat, InstanceDescriptor,
206-
InstanceFlags, InternalCounters, Limits, MemoryHints, MultisampleState, NoopBackendOptions,
207-
Origin2d, Origin3d, PipelineStatisticsTypes, PollError, PollStatus, PolygonMode,
208-
PowerPreference, PredefinedColorSpace, PresentMode, PresentationTimestamp, PrimitiveState,
209-
PrimitiveTopology, PushConstantRange, QueryType, RenderBundleDepthStencil, RequestAdapterError,
210-
SamplerBindingType, SamplerBorderColor, ShaderLocation, ShaderModel, ShaderRuntimeChecks,
211-
ShaderStages, StencilFaceState, StencilOperation, StencilState, StorageTextureAccess,
212-
SurfaceCapabilities, SurfaceStatus, TexelCopyBufferLayout, TextureAspect, TextureDimension,
213-
TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures, TextureSampleType,
214-
TextureTransition, TextureUsages, TextureUses, TextureViewDimension, Trace, VertexAttribute,
215-
VertexFormat, VertexStepMode, WasmNotSend, WasmNotSendSync, WasmNotSync, COPY_BUFFER_ALIGNMENT,
216-
COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
206+
InstanceFlags, InternalCounters, Limits, MemoryBudgetThresholds, MemoryHints, MultisampleState,
207+
NoopBackendOptions, Origin2d, Origin3d, PipelineStatisticsTypes, PollError, PollStatus,
208+
PolygonMode, PowerPreference, PredefinedColorSpace, PresentMode, PresentationTimestamp,
209+
PrimitiveState, PrimitiveTopology, PushConstantRange, QueryType, RenderBundleDepthStencil,
210+
RequestAdapterError, SamplerBindingType, SamplerBorderColor, ShaderLocation, ShaderModel,
211+
ShaderRuntimeChecks, ShaderStages, StencilFaceState, StencilOperation, StencilState,
212+
StorageTextureAccess, SurfaceCapabilities, SurfaceStatus, TexelCopyBufferLayout, TextureAspect,
213+
TextureDimension, TextureFormat, TextureFormatFeatureFlags, TextureFormatFeatures,
214+
TextureSampleType, TextureTransition, TextureUsages, TextureUses, TextureViewDimension, Trace,
215+
VertexAttribute, VertexFormat, VertexStepMode, WasmNotSend, WasmNotSendSync, WasmNotSync,
216+
COPY_BUFFER_ALIGNMENT, COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
217217
QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_STRIDE_ALIGNMENT,
218218
};
219219
<span class="attr">#[expect(deprecated)]

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2291,7 +2291,9 @@
22912291
<a href="#2290" id="2290">2290</a>
22922292
<a href="#2291" id="2291">2291</a>
22932293
<a href="#2292" id="2292">2292</a>
2294-
<a href="#2293" id="2293">2293</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{borrow::Cow, boxed::Box, string::String, sync::Arc, vec::Vec};
2294+
<a href="#2293" id="2293">2293</a>
2295+
<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};
22952297
<span class="kw">use </span>core::{ptr::NonNull, sync::atomic::Ordering};
22962298

22972299
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
@@ -4270,6 +4272,8 @@
42704272
<span class="kw">let </span>fence = device.fence.read();
42714273
<span class="kw">let </span>maintain_result = device.maintain(fence, poll_type, snatch_guard);
42724274

4275+
device.lose_if_oom();
4276+
42734277
<span class="comment">// Some deferred destroys are scheduled in maintain so run this right after
42744278
// to avoid holding on to them until the next device poll.
42754279
</span>device.deferred_resource_destruction();

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,28 @@
15711571
<a href="#1570" id="1570">1570</a>
15721572
<a href="#1571" id="1571">1571</a>
15731573
<a href="#1572" id="1572">1572</a>
1574-
<a href="#1573" id="1573">1573</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
1574+
<a href="#1573" id="1573">1573</a>
1575+
<a href="#1574" id="1574">1574</a>
1576+
<a href="#1575" id="1575">1575</a>
1577+
<a href="#1576" id="1576">1576</a>
1578+
<a href="#1577" id="1577">1577</a>
1579+
<a href="#1578" id="1578">1578</a>
1580+
<a href="#1579" id="1579">1579</a>
1581+
<a href="#1580" id="1580">1580</a>
1582+
<a href="#1581" id="1581">1581</a>
1583+
<a href="#1582" id="1582">1582</a>
1584+
<a href="#1583" id="1583">1583</a>
1585+
<a href="#1584" id="1584">1584</a>
1586+
<a href="#1585" id="1585">1585</a>
1587+
<a href="#1586" id="1586">1586</a>
1588+
<a href="#1587" id="1587">1587</a>
1589+
<a href="#1588" id="1588">1588</a>
1590+
<a href="#1589" id="1589">1589</a>
1591+
<a href="#1590" id="1590">1590</a>
1592+
<a href="#1591" id="1591">1591</a>
1593+
<a href="#1592" id="1592">1592</a>
1594+
<a href="#1593" id="1593">1593</a>
1595+
<a href="#1594" id="1594">1594</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
15751596
<span class="kw">use </span>core::{
15761597
iter,
15771598
mem::{<span class="self">self</span>, ManuallyDrop},
@@ -2036,6 +2057,8 @@
20362057
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::write_buffer"</span>);
20372058
<span class="macro">api_log!</span>(<span class="string">"Queue::write_buffer"</span>);
20382059

2060+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2061+
20392062
<span class="kw">let </span>buffer = buffer.get()<span class="question-mark">?</span>;
20402063

20412064
<span class="kw">let </span>data_size = data.len() <span class="kw">as </span>wgt::BufferAddress;
@@ -2082,6 +2105,8 @@
20822105
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::create_staging_buffer"</span>);
20832106
<span class="macro">resource_log!</span>(<span class="string">"Queue::create_staging_buffer"</span>);
20842107

2108+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2109+
20852110
<span class="kw">let </span>staging_buffer = StagingBuffer::new(<span class="kw-2">&amp;</span><span class="self">self</span>.device, buffer_size)<span class="question-mark">?</span>;
20862111
<span class="kw">let </span>ptr = <span class="kw">unsafe </span>{ staging_buffer.ptr() };
20872112

@@ -2096,6 +2121,8 @@
20962121
) -&gt; <span class="prelude-ty">Result</span>&lt;(), QueueWriteError&gt; {
20972122
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::write_staging_buffer"</span>);
20982123

2124+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2125+
20992126
<span class="kw">let </span>buffer = buffer.get()<span class="question-mark">?</span>;
21002127

21012128
<span class="kw">let </span>snatch_guard = <span class="self">self</span>.device.snatchable_lock.read();
@@ -2127,6 +2154,8 @@
21272154
) -&gt; <span class="prelude-ty">Result</span>&lt;(), QueueWriteError&gt; {
21282155
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::validate_write_buffer"</span>);
21292156

2157+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2158+
21302159
<span class="kw">let </span>buffer = buffer.get()<span class="question-mark">?</span>;
21312160

21322161
<span class="self">self</span>.validate_write_buffer_impl(<span class="kw-2">&amp;</span>buffer, buffer_offset, buffer_size)<span class="question-mark">?</span>;
@@ -2167,6 +2196,8 @@
21672196
buffer: Arc&lt;Buffer&gt;,
21682197
buffer_offset: u64,
21692198
) -&gt; <span class="prelude-ty">Result</span>&lt;(), QueueWriteError&gt; {
2199+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2200+
21702201
<span class="kw">let </span>transition = {
21712202
<span class="kw">let </span><span class="kw-2">mut </span>trackers = <span class="self">self</span>.device.trackers.lock();
21722203
trackers
@@ -2224,6 +2255,8 @@
22242255
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::write_texture"</span>);
22252256
<span class="macro">api_log!</span>(<span class="string">"Queue::write_texture"</span>);
22262257

2258+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2259+
22272260
<span class="kw">if </span>size.width == <span class="number">0 </span>|| size.height == <span class="number">0 </span>|| size.depth_or_array_layers == <span class="number">0 </span>{
22282261
<span class="macro">log::trace!</span>(<span class="string">"Ignoring write_texture of size 0"</span>);
22292262
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
@@ -2446,6 +2479,8 @@
24462479
) -&gt; <span class="prelude-ty">Result</span>&lt;(), QueueWriteError&gt; {
24472480
<span class="macro">profiling::scope!</span>(<span class="string">"Queue::copy_external_image_to_texture"</span>);
24482481

2482+
<span class="self">self</span>.device.check_is_valid()<span class="question-mark">?</span>;
2483+
24492484
<span class="kw">if </span>size.width == <span class="number">0 </span>|| size.height == <span class="number">0 </span>|| size.depth_or_array_layers == <span class="number">0 </span>{
24502485
<span class="macro">log::trace!</span>(<span class="string">"Ignoring write_texture of size 0"</span>);
24512486
<span class="kw">return </span><span class="prelude-val">Ok</span>(());
@@ -2649,6 +2684,11 @@
26492684
<span class="kw">let </span><span class="kw-2">mut </span>command_index_guard = <span class="self">self</span>.device.command_indices.write();
26502685
command_index_guard.active_submission_index += <span class="number">1</span>;
26512686
submit_index = command_index_guard.active_submission_index;
2687+
2688+
<span class="kw">if let </span><span class="prelude-val">Err</span>(e) = <span class="self">self</span>.device.check_is_valid() {
2689+
<span class="kw">break </span><span class="lifetime">'error </span><span class="prelude-val">Err</span>(e.into());
2690+
}
2691+
26522692
<span class="kw">let </span><span class="kw-2">mut </span>active_executions = Vec::new();
26532693

26542694
<span class="kw">let </span><span class="kw-2">mut </span>used_surface_textures = track::TextureUsageScope::default();
@@ -2915,6 +2955,8 @@
29152955
<span class="comment">// the closures should execute with nothing locked!
29162956
</span>callbacks.fire();
29172957

2958+
<span class="self">self</span>.device.lose_if_oom();
2959+
29182960
<span class="macro">api_log!</span>(<span class="string">"Queue::submit returned submit index {submit_index}"</span>);
29192961

29202962
<span class="prelude-val">Ok</span>(submit_index)

0 commit comments

Comments
 (0)