Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arcanization of wgpu core resources #3626

Merged
merged 204 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 108 commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
548cb51
First Arcanization no refcount, no lifetime
gents83 Mar 30, 2023
d685726
Keeping Arc only outside and not inside resource
gents83 Mar 30, 2023
ec28fc3
Merge pull request #1 from gfx-rs/master
gents83 Mar 31, 2023
44413ca
Fixing clippy errors
gents83 Apr 1, 2023
95141e7
Merge branch 'master' of https://github.com/gents83/wgpu
gents83 Apr 1, 2023
a9b3bcb
Removing unneeded replay feature
gents83 Apr 1, 2023
17b8e71
string::new doesn't take any arguments
Elabajaba Apr 2, 2023
c7e1c54
Changed doc to align to moved files
gents83 Apr 2, 2023
60d3070
Merge pull request #2 from Elabajaba/arc-release-mode-fix
gents83 Apr 2, 2023
ecd0cc2
Correct texture view creation for render pass
gents83 Apr 2, 2023
a1b6b81
Merge pull request #3 from gfx-rs/master
gents83 Apr 2, 2023
a4b83a5
Fixing staging buffer issue
gents83 Apr 4, 2023
4961a49
Merge branch 'master' of https://github.com/gents83/wgpu
gents83 Apr 4, 2023
aa4424e
Merge pull request #4 from gfx-rs/master
gents83 Apr 4, 2023
e1c9b91
Fix compiler errors for Metal backend
niklaskorz Apr 7, 2023
9077b43
Fix usage of active_submission_index.fetch_add
niklaskorz Apr 7, 2023
f72ff9d
Fix release build
niklaskorz Apr 7, 2023
669636a
Merge pull request #5 from niklaskorz/master
gents83 Apr 7, 2023
c7b08db
Merge pull request #6 from niklaskorz/atomic-fetch-add
gents83 Apr 7, 2023
c935ea2
Merge pull request #7 from niklaskorz/debug-assertions
gents83 Apr 7, 2023
b8e08db
Merge branch 'trunk' into master
gents83 Apr 7, 2023
0fc93d8
Fixing integration issues
gents83 Apr 7, 2023
2c09b19
Fixing doc, fmt and gles
gents83 Apr 7, 2023
cda59c6
Merge branch 'trunk' into master
gents83 Apr 7, 2023
fd92db5
Missing doc changes
gents83 Apr 7, 2023
b6a5d2a
Added _ due to non-exauhstive pattern addition
gents83 Apr 7, 2023
ea3120e
Avoid using `WasmAbi` functions on WebGPU backend
grovesNL Apr 8, 2023
c6c8259
Clippy
grovesNL Apr 8, 2023
42b1199
Changelog entry
grovesNL Apr 8, 2023
96e1f50
Remove wrongly created license in subfolders
gents83 Apr 9, 2023
e12a5f2
Merge pull request #9 from grovesNL/dynamic-dispatch-workaround
gents83 Apr 9, 2023
df9801b
Updating according to trace::Action::CreateTexture
gents83 Apr 9, 2023
b9d3c59
Moving set_id from registry to storage
gents83 Apr 9, 2023
1c2112f
Expose cleare fence for device polling
gents83 Apr 11, 2023
a9518cd
Merge branch 'trunk' into master
gents83 Apr 11, 2023
4a2ff45
Merge pull request #10 from gfx-rs/trunk
gents83 Apr 12, 2023
ffa0802
Fix format
gents83 Apr 12, 2023
5875645
Merge branch 'master' of https://github.com/gents83/wgpu
gents83 Apr 12, 2023
b0a80ea
Merge branch 'trunk' into master
gents83 Apr 15, 2023
ea90aa4
Integrating (#3686)
gents83 Apr 15, 2023
2f18676
Fixing integration
gents83 Apr 15, 2023
de80b11
Fixing wat on gles
gents83 Apr 15, 2023
e49aff2
Bumping extern libs
gents83 Apr 15, 2023
73fecae
Active submission will drop only its own stuff
gents83 Apr 16, 2023
faf3efb
Increasing wait time for multithreaded test
gents83 Apr 16, 2023
a1f8651
Reverting test and reducing cleanup time
gents83 Apr 16, 2023
6bc0ecf
Separating info from debug to get debug details
gents83 Apr 25, 2023
cd9022a
Merge branch 'trunk' into master
gents83 Apr 25, 2023
f2736e5
Fix merge issue
gents83 Apr 25, 2023
4529f73
Fix clippy wasm
gents83 Apr 25, 2023
8d6f531
Merge pull request #11 from gfx-rs/trunk
gents83 Apr 29, 2023
fbd23cc
Fixing temp suspected clear order
gents83 Apr 29, 2023
6c370d4
Merge branch 'master' of https://github.com/gents83/wgpu
gents83 Apr 29, 2023
2a3c78a
Adding drop to staging buffer
gents83 Apr 29, 2023
011ed1b
Better log info
gents83 Apr 29, 2023
404e888
Active submission index incremented only at submit
gents83 Apr 30, 2023
ddc015c
Fix fmt
gents83 Apr 30, 2023
be6cb83
Merge pull request #12 from gfx-rs/trunk
gents83 Apr 30, 2023
c5280f5
Merge branch 'trunk' into master
gents83 May 4, 2023
7778e1a
Drain submissions again
gents83 May 4, 2023
feae1b5
Merge branch 'trunk' into master
gents83 May 20, 2023
4640ec0
Integrating fix multiview rendering in resource.rs
gents83 May 20, 2023
15e3145
Readding licenses and helper functions
gents83 May 20, 2023
a0af81a
Fixing format
gents83 May 20, 2023
106b51b
Fixing wrong merge of create_render_bundle_error
gents83 May 23, 2023
dbd708e
Merge pull request #14 from gfx-rs/trunk
gents83 May 23, 2023
07c14e6
Use symlinks for wgpu{,-core,-hal,-types}/LICENSE.{APACHE,MIT}.
jimblandy May 22, 2023
3a5b0bd
Merge branch 'trunk' into arcanization
jimblandy May 24, 2023
cf74dc2
Merge branch 'trunk' into arcanization
jimblandy May 24, 2023
a07a1b3
Remove ResourceMetadataProvider::Resource and logs
gents83 May 27, 2023
9af2d0c
Adding some doc info
gents83 May 27, 2023
c498c28
Add missing dependency device\adapter
gents83 Jun 5, 2023
f9acbd3
Removing useless typo code
gents83 Jun 5, 2023
0bffddb
Merge branch 'trunk' into master
gents83 Jun 5, 2023
a3f4643
Fix merge conflicts errors
gents83 Jun 5, 2023
bfca2cd
Fix format
gents83 Jun 5, 2023
8850c89
Removing wait of specific submission index
gents83 Jun 6, 2023
9b47cb3
Merge branch 'trunk' into master
gents83 Jun 6, 2023
3a6fdc7
rustup update
gents83 Jun 6, 2023
0ebf406
Merge branch 'trunk' into master
gents83 Jun 6, 2023
e0e2297
Document abandoned buffer conditions more explicitly.
jimblandy May 31, 2023
252fbf3
Merge branch 'trunk' into master
gents83 Jun 10, 2023
8bdc4b9
Fixing CI
gents83 Jun 10, 2023
8c0de8c
Merge branch 'trunk' into master
gents83 Jun 17, 2023
dcf751b
Move trackers locks after the pending_writes lock
gents83 Jun 17, 2023
e219604
Adding additional doc
gents83 Jun 17, 2023
2ce35f1
Adding deadlock detection in tests
gents83 Jun 17, 2023
c6e9de8
Fixed wrong check
gents83 Jun 17, 2023
5b34df5
Merge branch 'trunk' into master
gents83 Jun 24, 2023
7469572
Updating changelog
gents83 Jun 24, 2023
91d872e
Merge branch 'trunk' into master
gents83 Jul 7, 2023
f2ca336
Using mutex on pending_writes
Jul 7, 2023
9243a92
Pending writes locked before textures transitions
Jul 7, 2023
b2113b6
Merge branch 'trunk' into master
gents83 Jul 15, 2023
52cf370
Fixing merge integration resolve conflicts
Jul 15, 2023
71b2af6
Fix fmt
Jul 15, 2023
a65bb07
Adding more info on resource tracking
gents83 Jul 24, 2023
dcea4dd
Merge branch 'trunk' into master
gents83 Jul 24, 2023
633035f
Fix fmt
gents83 Jul 24, 2023
94801a5
Aligning to workspace
gents83 Jul 24, 2023
94180a3
Merge branch 'trunk' into master
gents83 Jul 27, 2023
6babd06
Clearing temp_suspected once moved to suspected
gents83 Jul 27, 2023
2e0baad
Merge branch 'trunk' into master
gents83 Jul 27, 2023
d5943e7
Restoring Action::CreateTexture for Player
gents83 Jul 31, 2023
0cb20d4
Merge branch 'trunk' into master
gents83 Jul 31, 2023
c7ed2c1
Merge branch 'trunk' into master
gents83 Aug 1, 2023
b763431
Fix memleaks due to duplicated items + drain usage
gents83 Aug 1, 2023
7b28fe4
Adding proper release of surface texture view
gents83 Aug 2, 2023
8da3493
Merge branch 'trunk' into master
gents83 Aug 17, 2023
481c914
Fix integration issues
gents83 Aug 17, 2023
1312b26
Using always is_unique()
gents83 Aug 17, 2023
6690fe4
Queue is now keeping device alive till needed
gents83 Aug 18, 2023
4b93702
RenderBundle has strong reference to its device
gents83 Aug 18, 2023
a483132
Removing check for test on wasm
gents83 Aug 18, 2023
27d2efa
Merge branch 'trunk' into master
gents83 Aug 18, 2023
586c1bb
Apply cargo fmt
gents83 Aug 18, 2023
b175774
Let Presentation hold a strong reference to its Device.
jimblandy Aug 19, 2023
028726e
Merge pull request #15 from jimblandy/presentation-arc-device
gents83 Aug 19, 2023
f71b2dc
Introducing AnySurface
gents83 Aug 19, 2023
007a53d
Fixing clippy
gents83 Aug 19, 2023
4f46d49
Merge branch 'trunk' into master
gents83 Aug 19, 2023
c108c9a
When clearing a Hub, remember to remove the surface's presentation.
jimblandy Aug 19, 2023
e65bdd2
Improving error msg
gents83 Aug 25, 2023
38eb9ac
TypeId should be debuggable
gents83 Aug 25, 2023
50e326d
Merge branch 'master' of https://github.com/gents83/wgpu into wgpu/ma…
gents83 Aug 25, 2023
f974beb
Improving log
gents83 Aug 25, 2023
ad03f83
Merge branch 'trunk' into master
gents83 Aug 26, 2023
579edb6
Fix integration issues
gents83 Aug 26, 2023
b9b1556
Removing valid and adding is_valid
gents83 Aug 26, 2023
865910f
Merge branch 'master' into Creating-AnySurface
gents83 Aug 26, 2023
9e2a0ed
Merge pull request #16 from gents83/Creating-AnySurface
gents83 Aug 26, 2023
da588ff
Keep resources in registry till user release them
gents83 Aug 26, 2023
1765710
First anysurface will win
gents83 Aug 26, 2023
c4f150d
Fixing locking
gents83 Aug 26, 2023
4f1bcab
Fix compilation error
gents83 Aug 26, 2023
969e411
Fixing wasm32
gents83 Aug 27, 2023
27d5a68
Fix wasm compilation
gents83 Aug 27, 2023
7394fd7
Storage is now only for user - wgpu use arcs
gents83 Sep 8, 2023
c235de4
Merge branch 'trunk' into master
gents83 Sep 8, 2023
490b2b7
Fixing integration issues and merge conflicts
gents83 Sep 8, 2023
451dfba
Fixing clippy wasm32
gents83 Sep 8, 2023
6839dba
Fixing mem_leaks on wasm
gents83 Sep 8, 2023
058c8af
Updating doc
gents83 Sep 8, 2023
6a66746
Fix format
gents83 Sep 9, 2023
f83fdad
Fix fmt
gents83 Sep 9, 2023
c5aa05f
Improving resource dropping in device poll
gents83 Sep 10, 2023
9a24345
Add release of buffer and description on texture
gents83 Sep 13, 2023
e52c747
Fix format
gents83 Sep 16, 2023
90c118d
Merge branch 'trunk' into master
gents83 Sep 16, 2023
45a618f
Fix merge conflicts and improve id mngmnt
gents83 Sep 16, 2023
88dc35c
Fixing surface present issue
gents83 Sep 18, 2023
8ca3cb0
Fixing texture leaking due to clear view
gents83 Sep 19, 2023
0220754
Merge branch 'trunk' into master
gents83 Sep 19, 2023
d1fe60c
QuerySet error drop not failing
gents83 Sep 19, 2023
fb13cc8
Better resource triage_suspected
gents83 Sep 21, 2023
ac30622
Fix test
gents83 Sep 22, 2023
4e68258
Fix format
gents83 Sep 22, 2023
0eac205
Improving tracker management
gents83 Sep 23, 2023
3530dcb
Releasing bind group resources fix missing leaks
gents83 Sep 23, 2023
b2d5462
Merge branch 'trunk' into master
gents83 Oct 1, 2023
d4a8689
Resolve merge conflicts
gents83 Oct 1, 2023
af51987
Fixing command order issue
gents83 Oct 7, 2023
c66473a
Merge branch 'trunk' into master
gents83 Oct 7, 2023
877ef94
Fix integration and simply layout groups dedup
gents83 Oct 7, 2023
a7de4da
Fixing clippy doc
gents83 Oct 7, 2023
b31ddb0
Merge branch 'trunk' into master
gents83 Oct 8, 2023
5d08672
Fix clippy fmt
gents83 Oct 8, 2023
b7e518a
Fix wrong checks on is_valid and is_incompatible
gents83 Oct 8, 2023
b997eaf
Merge branch 'trunk' into master
gents83 Oct 9, 2023
cbf8860
Applying cargo fmt
gents83 Oct 9, 2023
cc4d15c
Merge branch 'trunk' into master
gents83 Oct 9, 2023
804f1da
Fix integration issues
gents83 Oct 9, 2023
b33c1c2
Merge branch 'trunk' into master
gents83 Oct 9, 2023
092fd3e
Merge branch 'trunk' into master
gents83 Oct 12, 2023
41f8171
Fix format
gents83 Oct 12, 2023
ad0109a
Fix integration
gents83 Oct 12, 2023
dbde6dd
Fix merge
gents83 Oct 12, 2023
2af22cd
Fix compilation
gents83 Oct 12, 2023
d5fdf2c
Merge branch 'trunk' into master
gents83 Oct 14, 2023
22b1471
Fix integration
gents83 Oct 14, 2023
2fb0218
Removing wrong merge
gents83 Oct 14, 2023
12d16ee
Fixing issue on zero_init_texture test
gents83 Oct 15, 2023
b0984ef
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Oct 21, 2023
7f727b0
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Oct 23, 2023
c6e1e28
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Oct 25, 2023
b140f6a
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Oct 30, 2023
93cffd2
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Oct 30, 2023
535011b
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 3, 2023
aa1a05f
Fixing double lock on buffer destroy + test added
gents83 Nov 5, 2023
1198114
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 5, 2023
ae0b777
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 10, 2023
673af75
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 10, 2023
2710cdd
Merge branch 'trunk' into master
gents83 Nov 10, 2023
8bc7140
Merge branch 'master' of https://github.com/gents83/wgpu into wgpu/ma…
gents83 Nov 10, 2023
2cfa766
Fixing wrong merge
gents83 Nov 10, 2023
090c9c3
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 13, 2023
715bd00
Fixing changelog integration
gents83 Nov 13, 2023
b6d61da
Fix insert_impl and take_and_mark_destroyed
gents83 Nov 13, 2023
c8a60e2
Fix fmt
gents83 Nov 13, 2023
ff042c4
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu
Nov 16, 2023
24393a4
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into wgpu/master
gents83 Nov 18, 2023
0e437be
Updated changelog
gents83 Nov 18, 2023
724fc1a
Shorten lock durations to avoid deadlocks
SludgePhD Nov 18, 2023
e4cec38
Merge pull request #17 from SludgePhD/arcanization
gents83 Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_LOG: info
RUST_BACKTRACE: full
RUST_LOG: info #needed to understand what's going on when tests fail
MSRV: 1.65
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,19 @@ By @fornwall in [#3904](https://github.com/gfx-rs/wgpu/pull/3904) and [#3905](ht
#### Misc Breaking Changes

- Change `AdapterInfo::{device,vendor}` to be `u32` instead of `usize`. By @ameknite in [#3760](https://github.com/gfx-rs/wgpu/pull/3760)
- Remove the `backend_bits` parameter in `initialize_adapter_from_env` and `initialize_adapter_from_env_or_default` - use [InstanceDescriptor::backends](https://docs.rs/wgpu/latest/wgpu/struct.InstanceDescriptor.html#structfield.backends) instead. By @fornwall in [#3904](https://github.com/gfx-rs/wgpu/pull/3904)
- Arcanization of wgpu core resources: Removed 'Token' and 'LifeTime' related management,
removed 'RefCount' and 'MultiRefCount' in favour of using only 'Arc' internal reference count, removing mut from resources and added instead internal members locks on demand or atomics operations, resources now implement Drop and destroy stuff when last 'Arc' resources is released, resources hold an 'Arc' in order to be able to implement Drop, resources have an utility to retrieve the id of the resource itself, removed all guards and just retrive the 'Arc' needed on-demand to unlock registry of resources asap removing locking from hot paths. By @gents83 in [#3626](https://github.com/gfx-rs/wgpu/pull/3626) and tnx also to @jimblandy

#### DX12

- Increase the `max_storage_buffers_per_shader_stage` and `max_storage_textures_per_shader_stage` limits based on what the hardware supports. by @Elabajaba in [#3798]https://github.com/gfx-rs/wgpu/pull/3798
- Add a `compatible_surface` parameter to `initialize_adapter_from_env` and use that to make `initialize_adapter_from_env_or_default` always respect its `compatible_surface` parameter. By @fornwall in [#3905](https://github.com/gfx-rs/wgpu/pull/3905)
gents83 marked this conversation as resolved.
Show resolved Hide resolved

### Changes

- Added support for importing external buffers using `buffer_from_raw` (Dx12, Metal, Vulkan) and `create_buffer_from_hal`. By @AdrianEddy in [#3355](https://github.com/gfx-rs/wgpu/pull/3355)


#### Vulkan

- Work around [Vulkan-ValidationLayers#5671](https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/5671) by ignoring reports of violations of [VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912). By @jimblandy in [#3809](https://github.com/gfx-rs/wgpu/pull/3809).
Expand Down
30 changes: 27 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions deno_webgpu/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl From<DeviceError> for WebGpuError {
DeviceError::Lost => WebGpuError::Lost,
DeviceError::OutOfMemory => WebGpuError::OutOfMemory,
DeviceError::Invalid => WebGpuError::Validation(fmt_err(&err)),
_ => WebGpuError::Validation(fmt_err(&err)),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions player/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl GlobalPlay for wgc::global::Global<IdentityPassThroughFactory> {
comb_manager: &mut wgc::identity::IdentityManager,
) {
use wgc::device::trace::Action;
log::info!("action {:?}", action);
log::debug!("action {:?}", action);
//TODO: find a way to force ID perishing without excessive `maintain()` calls.
match action {
Action::Init { .. } => {
Expand Down Expand Up @@ -254,7 +254,7 @@ impl GlobalPlay for wgc::global::Global<IdentityPassThroughFactory> {
self.bind_group_drop::<A>(id);
}
Action::CreateShaderModule { id, desc, data } => {
log::info!("Creating shader from {}", data);
log::debug!("Creating shader from {}", data);
let code = fs::read_to_string(dir.join(&data)).unwrap();
let source = if data.ends_with(".wgsl") {
wgc::pipeline::ShaderModuleSource::Wgsl(Cow::Owned(code))
Expand Down
2 changes: 1 addition & 1 deletion player/tests/data/zero-init-texture-binding.ron
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
format: "rgba8unorm",
usage: 9, // STORAGE + COPY_SRC
view_formats: [],
)),
)),
CreateTextureView(
id: Id(1, 1, Empty),
parent_id: Id(1, 1, Empty),
Expand Down
1 change: 1 addition & 0 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ wgt.workspace = true

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
nv-flip.workspace = true
parking_lot = { workspace = true, features = ["deadlock_detection"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_log.workspace = true
Expand Down
32 changes: 31 additions & 1 deletion tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
//! This module contains common test-only code that needs to be shared between the examples and the tests.
#![allow(dead_code)] // This module is used in a lot of contexts and only parts of it will be used

use std::panic::{catch_unwind, AssertUnwindSafe};
use std::{
panic::{catch_unwind, AssertUnwindSafe},
sync::{atomic::AtomicBool, Arc},
};

use wgpu::{Adapter, Device, DownlevelFlags, Instance, Queue, Surface};
use wgt::{Backends, DeviceDescriptor, DownlevelCapabilities, Features, Limits};
Expand Down Expand Up @@ -307,7 +310,34 @@ pub fn initialize_test(parameters: TestParameters, test_function: impl FnOnce(Te
return;
}

let is_running = Arc::new(AtomicBool::new(true));
#[cfg(not(target_arch = "wasm32"))]
{
let is_running = is_running.clone();
// Create a background thread which checks for deadlocks every 3 seconds
std::thread::spawn(move || loop {
if !is_running.load(std::sync::atomic::Ordering::Relaxed) {
break;
}
std::thread::sleep(core::time::Duration::from_secs(3));
let deadlocks = parking_lot::deadlock::check_deadlock();
if deadlocks.is_empty() {
continue;
}
is_running.store(false, std::sync::atomic::Ordering::Relaxed);
println!("{} deadlocks detected", deadlocks.len());
for (i, threads) in deadlocks.iter().enumerate() {
println!("Deadlock #{}", i);
for t in threads {
println!("Thread Id {:#?}", t.thread_id());
println!("{:#?}", t.backtrace());
}
}
});
}

let panicked = catch_unwind(AssertUnwindSafe(|| test_function(context))).is_err();
is_running.store(false, std::sync::atomic::Ordering::Relaxed);
cfg_if::cfg_if!(
if #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))] {
let canary_set = wgpu::hal::VALIDATION_CANARY.get_and_reset();
Expand Down
4 changes: 1 addition & 3 deletions wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ smallvec = "1"
thiserror = "1"

[dependencies.naga]
git = "https://github.com/gfx-rs/naga"
rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079"
version = "0.13.0"
workspace = true
gents83 marked this conversation as resolved.
Show resolved Hide resolved
features = ["clone", "span", "validate"]

[dependencies.wgt]
Expand Down
Loading