Skip to content

Commit 1e143bb

Browse files
committed
[wgpu]: Switch to wgpu-types for locking primitives
1 parent 78341a4 commit 1e143bb

4 files changed

Lines changed: 9 additions & 68 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wgpu/Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ ignored = ["cfg_aliases"]
3535
[features]
3636
default = [
3737
"std",
38-
"parking_lot",
3938
"dx12",
4039
"metal",
4140
"gles",
@@ -191,9 +190,9 @@ std = [
191190
##
192191
## This is a recommended feature for most users and should only be disabled when
193192
## required, e.g., for `no_std` support.
194-
## If disabled, either `std::sync::Mutex` or `core::cell::RefCell` will be used,
195-
## based on whether `std` is enabled or not.
196-
parking_lot = ["dep:parking_lot"]
193+
## If disabled, `core::cell::RefCell` will be used.
194+
# FIXME: This can probably be removed as a feature and directly controlled by `std`
195+
parking_lot = ["wgpu-types/std"]
197196

198197
## Enables `exhaust` method for `TextureFormat` of `wgpu-types`.
199198
##
@@ -217,7 +216,6 @@ cfg-if.workspace = true
217216
document-features.workspace = true
218217
log.workspace = true
219218
hashbrown.workspace = true
220-
parking_lot = { workspace = true, optional = true }
221219
profiling.workspace = true
222220
raw-window-handle = { workspace = true, features = ["alloc"] }
223221
static_assertions.workspace = true
@@ -238,6 +236,11 @@ wgpu-core = { workspace = true, features = [
238236
] }
239237
wgpu-hal.workspace = true
240238

239+
# FIXME: Native platforms mandate `Send`/`Sync`, which is only possible with `std` enabled.
240+
wgpu-types = { workspace = true, features = [
241+
"std",
242+
] }
243+
241244
smallvec.workspace = true
242245

243246
###############

wgpu/src/util/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ mod belt;
1010
mod device;
1111
mod encoder;
1212
mod init;
13-
mod mutex;
1413
mod panicking;
1514
mod spirv;
1615
mod texture_blitter;
@@ -29,8 +28,8 @@ pub use wgt::{
2928
math::*, DispatchIndirectArgs, DrawIndexedIndirectArgs, DrawIndirectArgs, TextureDataOrder,
3029
};
3130

32-
pub(crate) use mutex::Mutex;
3331
pub(crate) use panicking::is_panicking;
32+
pub(crate) use wgt::sync::Mutex;
3433

3534
use crate::BufferUsages;
3635

wgpu/src/util/mutex.rs

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)