Skip to content

Commit db4d78b

Browse files
Deploying to master from @ gfx-rs/wgpu@326ad03 🚀
1 parent 2598eb0 commit db4d78b

File tree

1,434 files changed

+7104
-7031
lines changed

Some content is hidden

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

1,434 files changed

+7104
-7031
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_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/api/adapter.rs.html

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,7 @@
199199
<a href="#198" id="198">198</a>
200200
<a href="#199" id="199">199</a>
201201
<a href="#200" id="200">200</a>
202-
<a href="#201" id="201">201</a>
203-
<a href="#202" id="202">202</a>
204-
<a href="#203" id="203">203</a>
205-
<a href="#204" id="204">204</a></pre></div><pre class="rust"><code><span class="kw">use </span>core::future::Future;
202+
<a href="#201" id="201">201</a></pre></div><pre class="rust"><code><span class="kw">use </span>core::future::Future;
206203

207204
<span class="kw">use crate</span>::<span class="kw-2">*</span>;
208205

@@ -250,8 +247,7 @@
250247
/// # Arguments
251248
///
252249
/// - `desc` - Description of the features and limits requested from the given device.
253-
/// - `trace_path` - Can be used for API call tracing, if that feature is
254-
/// enabled in `wgpu-core`.
250+
/// - `trace` - Can be used for API call tracing, if the feature is enabled.
255251
///
256252
/// # Panics
257253
///
@@ -265,9 +261,8 @@
265261
</span><span class="kw">pub fn </span>request_device(
266262
<span class="kw-2">&amp;</span><span class="self">self</span>,
267263
desc: <span class="kw-2">&amp;</span>DeviceDescriptor&lt;<span class="lifetime">'_</span>&gt;,
268-
trace_path: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::Path&gt;,
269264
) -&gt; <span class="kw">impl </span>Future&lt;Output = <span class="prelude-ty">Result</span>&lt;(Device, Queue), RequestDeviceError&gt;&gt; + WasmNotSend {
270-
<span class="kw">let </span>device = <span class="self">self</span>.inner.request_device(desc, trace_path);
265+
<span class="kw">let </span>device = <span class="self">self</span>.inner.request_device(desc);
271266
<span class="kw">async move </span>{
272267
device
273268
.<span class="kw">await
@@ -286,13 +281,12 @@
286281
<span class="kw-2">&amp;</span><span class="self">self</span>,
287282
hal_device: hal::OpenDevice&lt;A&gt;,
288283
desc: <span class="kw-2">&amp;</span>DeviceDescriptor&lt;<span class="lifetime">'_</span>&gt;,
289-
trace_path: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::Path&gt;,
290284
) -&gt; <span class="prelude-ty">Result</span>&lt;(Device, Queue), RequestDeviceError&gt; {
291285
<span class="kw">let </span>core_adapter = <span class="self">self</span>.inner.as_core();
292286
<span class="kw">let </span>(device, queue) = <span class="kw">unsafe </span>{
293287
core_adapter
294288
.context
295-
.create_device_from_hal(core_adapter, hal_device, desc, trace_path)
289+
.create_device_from_hal(core_adapter, hal_device, desc)
296290
}<span class="question-mark">?</span>;
297291

298292
<span class="prelude-val">Ok</span>((

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

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,7 +3614,15 @@
36143614
<a href="#3613" id="3613">3613</a>
36153615
<a href="#3614" id="3614">3614</a>
36163616
<a href="#3615" id="3615">3615</a>
3617-
<a href="#3616" id="3616">3616</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3617+
<a href="#3616" id="3616">3616</a>
3618+
<a href="#3617" id="3617">3617</a>
3619+
<a href="#3618" id="3618">3618</a>
3620+
<a href="#3619" id="3619">3619</a>
3621+
<a href="#3620" id="3620">3620</a>
3622+
<a href="#3621" id="3621">3621</a>
3623+
<a href="#3622" id="3622">3622</a>
3624+
<a href="#3623" id="3623">3623</a>
3625+
<a href="#3624" id="3624">3624</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
36183626
borrow::Cow::Borrowed,
36193627
boxed::Box,
36203628
format,
@@ -3720,19 +3728,23 @@
37203728
adapter: <span class="kw-2">&amp;</span>CoreAdapter,
37213729
hal_device: hal::OpenDevice&lt;A&gt;,
37223730
desc: <span class="kw-2">&amp;</span><span class="kw">crate</span>::DeviceDescriptor&lt;<span class="lifetime">'_</span>&gt;,
3723-
trace_dir: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::Path&gt;,
37243731
) -&gt; <span class="prelude-ty">Result</span>&lt;(CoreDevice, CoreQueue), <span class="kw">crate</span>::RequestDeviceError&gt; {
3725-
<span class="kw">if </span>trace_dir.is_some() {
3726-
<span class="macro">log::error!</span>(<span class="string">"Feature 'trace' has been removed temporarily, see https://github.com/gfx-rs/wgpu/issues/5974"</span>);
3732+
<span class="kw">if </span>!<span class="macro">matches!</span>(desc.trace, wgt::Trace::Off) {
3733+
<span class="macro">log::error!</span>(
3734+
<span class="string">"
3735+
Feature 'trace' has been removed temporarily; \
3736+
see https://github.com/gfx-rs/wgpu/issues/5974. \
3737+
The `trace` parameter will have no effect."
3738+
</span>);
37273739
}
3740+
37283741
<span class="kw">let </span>(device_id, queue_id) = <span class="kw">unsafe </span>{
37293742
<span class="self">self</span>.<span class="number">0</span>.create_device_from_hal(
37303743
adapter.id,
37313744
hal_device.into(),
37323745
<span class="kw-2">&amp;</span>desc.map_label(|l| l.map(Borrowed)),
37333746
<span class="prelude-val">None</span>,
37343747
<span class="prelude-val">None</span>,
3735-
<span class="prelude-val">None</span>,
37363748
)
37373749
}<span class="question-mark">?</span>;
37383750
<span class="kw">let </span>error_sink = Arc::new(Mutex::new(ErrorSinkRaw::new()));
@@ -4492,17 +4504,21 @@
44924504
<span class="kw">fn </span>request_device(
44934505
<span class="kw-2">&amp;</span><span class="self">self</span>,
44944506
desc: <span class="kw-2">&amp;</span><span class="kw">crate</span>::DeviceDescriptor&lt;<span class="lifetime">'_</span>&gt;,
4495-
trace_dir: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::Path&gt;,
44964507
) -&gt; Pin&lt;Box&lt;<span class="kw">dyn </span>dispatch::RequestDeviceFuture&gt;&gt; {
4497-
<span class="kw">if </span>trace_dir.is_some() {
4498-
<span class="macro">log::error!</span>(<span class="string">"Feature 'trace' has been removed temporarily, see https://github.com/gfx-rs/wgpu/issues/5974"</span>);
4508+
<span class="kw">if </span>!<span class="macro">matches!</span>(desc.trace, wgt::Trace::Off) {
4509+
<span class="macro">log::error!</span>(
4510+
<span class="string">"
4511+
Feature 'trace' has been removed temporarily; \
4512+
see https://github.com/gfx-rs/wgpu/issues/5974. \
4513+
The `trace` parameter will have no effect."
4514+
</span>);
44994515
}
4516+
45004517
<span class="kw">let </span>res = <span class="self">self</span>.context.<span class="number">0</span>.adapter_request_device(
45014518
<span class="self">self</span>.id,
45024519
<span class="kw-2">&amp;</span>desc.map_label(|l| l.map(Borrowed)),
45034520
<span class="prelude-val">None</span>,
45044521
<span class="prelude-val">None</span>,
4505-
<span class="prelude-val">None</span>,
45064522
);
45074523
<span class="kw">let </span>(device_id, queue_id) = <span class="kw">match </span>res {
45084524
<span class="prelude-val">Ok</span>(ids) =&gt; ids,

doc/src/wgpu/dispatch.rs.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,7 @@
815815
<a href="#814" id="814">814</a>
816816
<a href="#815" id="815">815</a>
817817
<a href="#816" id="816">816</a>
818-
<a href="#817" id="817">817</a>
819-
<a href="#818" id="818">818</a></pre></div><pre class="rust"><code><span class="doccomment">//! Infrastructure for dispatching calls to the appropriate "backend". The "backends" are:
818+
<a href="#817" id="817">817</a></pre></div><pre class="rust"><code><span class="doccomment">//! Infrastructure for dispatching calls to the appropriate "backend". The "backends" are:
820819
//!
821820
//! - `wgpu_core`: An implementation of the the wgpu api on top of various native graphics APIs.
822821
//! - `webgpu`: An implementation of the wgpu api which calls WebGPU directly.
@@ -900,7 +899,6 @@
900899
<span class="kw">fn </span>request_device(
901900
<span class="kw-2">&amp;</span><span class="self">self</span>,
902901
desc: <span class="kw-2">&amp;</span><span class="kw">crate</span>::DeviceDescriptor&lt;<span class="lifetime">'_</span>&gt;,
903-
trace_dir: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::Path&gt;,
904902
) -&gt; Pin&lt;Box&lt;<span class="kw">dyn </span>RequestDeviceFuture&gt;&gt;;
905903

906904
<span class="kw">fn </span>is_surface_supported(<span class="kw-2">&amp;</span><span class="self">self</span>, surface: <span class="kw-2">&amp;</span>DispatchSurface) -&gt; bool;

doc/src/wgpu/lib.rs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
StencilFaceState, StencilOperation, StencilState, StorageTextureAccess, SurfaceCapabilities,
212212
SurfaceStatus, TexelCopyBufferLayout, TextureAspect, TextureDimension, TextureFormat,
213213
TextureFormatFeatureFlags, TextureFormatFeatures, TextureSampleType, TextureTransition,
214-
TextureUsages, TextureUses, TextureViewDimension, VertexAttribute, VertexFormat,
214+
TextureUsages, TextureUses, TextureViewDimension, Trace, VertexAttribute, VertexFormat,
215215
VertexStepMode, WasmNotSend, WasmNotSendSync, WasmNotSync, COPY_BUFFER_ALIGNMENT,
216216
COPY_BYTES_PER_ROW_ALIGNMENT, MAP_ALIGNMENT, PUSH_CONSTANT_ALIGNMENT,
217217
QUERY_RESOLVE_BUFFER_ALIGNMENT, QUERY_SET_MAX_QUERIES, QUERY_SIZE, VERTEX_STRIDE_ALIGNMENT,

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

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,7 +3838,24 @@
38383838
<a href="#3837" id="3837">3837</a>
38393839
<a href="#3838" id="3838">3838</a>
38403840
<a href="#3839" id="3839">3839</a>
3841-
<a href="#3840" id="3840">3840</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
3841+
<a href="#3840" id="3840">3840</a>
3842+
<a href="#3841" id="3841">3841</a>
3843+
<a href="#3842" id="3842">3842</a>
3844+
<a href="#3843" id="3843">3843</a>
3845+
<a href="#3844" id="3844">3844</a>
3846+
<a href="#3845" id="3845">3845</a>
3847+
<a href="#3846" id="3846">3846</a>
3848+
<a href="#3847" id="3847">3847</a>
3849+
<a href="#3848" id="3848">3848</a>
3850+
<a href="#3849" id="3849">3849</a>
3851+
<a href="#3850" id="3850">3850</a>
3852+
<a href="#3851" id="3851">3851</a>
3853+
<a href="#3852" id="3852">3852</a>
3854+
<a href="#3853" id="3853">3853</a>
3855+
<a href="#3854" id="3854">3854</a>
3856+
<a href="#3855" id="3855">3855</a>
3857+
<a href="#3856" id="3856">3856</a>
3858+
<a href="#3857" id="3857">3857</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{
38423859
borrow::Cow,
38433860
boxed::Box,
38443861
string::{String, ToString <span class="kw">as _</span>},
@@ -4040,13 +4057,27 @@
40404057
raw_device: Box&lt;<span class="kw">dyn </span>hal::DynDevice&gt;,
40414058
adapter: <span class="kw-2">&amp;</span>Arc&lt;Adapter&gt;,
40424059
desc: <span class="kw-2">&amp;</span>DeviceDescriptor,
4043-
trace_dir_name: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>str&gt;,
40444060
instance_flags: wgt::InstanceFlags,
40454061
) -&gt; <span class="prelude-ty">Result</span>&lt;<span class="self">Self</span>, DeviceError&gt; {
40464062
<span class="attr">#[cfg(not(feature = <span class="string">"trace"</span>))]
4047-
</span><span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw">_</span>) = trace_dir_name {
4048-
<span class="macro">log::error!</span>(<span class="string">"Feature 'trace' is not enabled"</span>);
4049-
}
4063+
</span><span class="kw">match </span><span class="kw-2">&amp;</span>desc.trace {
4064+
wgt::Trace::Off =&gt; {}
4065+
<span class="kw">_ </span>=&gt; {
4066+
<span class="macro">log::error!</span>(<span class="string">"wgpu-core feature 'trace' is not enabled"</span>);
4067+
}
4068+
};
4069+
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
4070+
</span><span class="kw">let </span>trace_dir_name: <span class="prelude-ty">Option</span>&lt;<span class="kw-2">&amp;</span>std::path::PathBuf&gt; = <span class="kw">match </span><span class="kw-2">&amp;</span>desc.trace {
4071+
wgt::Trace::Off =&gt; <span class="prelude-val">None</span>,
4072+
wgt::Trace::Directory(d) =&gt; <span class="prelude-val">Some</span>(d),
4073+
<span class="comment">// The enum is non_exhaustive, so we must have a fallback arm (that should be
4074+
// unreachable in practice).
4075+
</span>t =&gt; {
4076+
<span class="macro">log::error!</span>(<span class="string">"unimplemented wgpu_types::Trace variant {t:?}"</span>);
4077+
<span class="prelude-val">None
4078+
</span>}
4079+
};
4080+
40504081
<span class="kw">let </span>fence = <span class="kw">unsafe </span>{ raw_device.create_fence() }.map_err(DeviceError::from_hal)<span class="question-mark">?</span>;
40514082

40524083
<span class="kw">let </span>command_allocator = command::CommandAllocator::new();
@@ -4112,16 +4143,19 @@
41124143
<span class="attr">#[cfg(feature = <span class="string">"trace"</span>)]
41134144
</span>trace: Mutex::new(
41144145
rank::DEVICE_TRACE,
4115-
trace_dir_name.and_then(|dir_path_name| <span class="kw">match </span>trace::Trace::new(dir_path_name) {
4146+
trace_dir_name.and_then(|path| <span class="kw">match </span>trace::Trace::new(path.clone()) {
41164147
<span class="prelude-val">Ok</span>(<span class="kw-2">mut </span>trace) =&gt; {
41174148
trace.add(trace::Action::Init {
4118-
desc: desc.clone(),
4149+
desc: wgt::DeviceDescriptor {
4150+
trace: wgt::Trace::Off,
4151+
..desc.clone()
4152+
},
41194153
backend: adapter.backend(),
41204154
});
41214155
<span class="prelude-val">Some</span>(trace)
41224156
}
41234157
<span class="prelude-val">Err</span>(e) =&gt; {
4124-
<span class="macro">log::error!</span>(<span class="string">"Unable to start a trace in '{dir_path_name:?}': {e}"</span>);
4158+
<span class="macro">log::error!</span>(<span class="string">"Unable to start a trace in '{path:?}': {e}"</span>);
41254159
<span class="prelude-val">None
41264160
</span>}
41274161
}),

0 commit comments

Comments
 (0)