mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 14:31:08 +01:00
wgpu-core: use wgpu-sync for atomics
This commit is contained in:
1 parent
aa9d8af9f5
commit
1098476cd0
4 files changed
+3
-12
No files matched your search
Generated
-1
@@ -4795,7 +4795,6 @@ dependencies = [
|
||||
"naga",
|
||||
"naga-types",
|
||||
"num-traits",
|
||||
"portable-atomic",
|
||||
"profiling",
|
||||
"proptest",
|
||||
"raw-window-handle",
|
||||
|
||||
@@ -121,7 +121,7 @@ std = ["wgpu-sync/std"]
|
||||
static-dxc = ["wgpu-hal/static-dxc"]
|
||||
|
||||
## Enable portable atomics on platforms that do not support 64bit atomics.
|
||||
portable-atomic = ["dep:portable-atomic", "wgpu-hal/portable-atomic"]
|
||||
portable-atomic = ["wgpu-sync/portable-atomic", "wgpu-hal/portable-atomic"]
|
||||
|
||||
#! ### Target Conditional Features
|
||||
# --------------------------------------------------------------------
|
||||
@@ -208,9 +208,6 @@ serde = { workspace = true, features = ["derive"], default-features = false, opt
|
||||
smallvec.workspace = true
|
||||
thiserror.workspace = true
|
||||
|
||||
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
|
||||
portable-atomic = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
|
||||
proptest.workspace = true
|
||||
|
||||
|
||||
@@ -25,7 +25,5 @@ fn main() {
|
||||
any(target_os = "linux", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")
|
||||
) },
|
||||
metal: { all(target_vendor = "apple", feature = "metal") },
|
||||
|
||||
supports_64bit_atomics: { target_has_atomic = "64" }
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,13 @@ use core::{
|
||||
fmt,
|
||||
mem::{self, ManuallyDrop},
|
||||
num::NonZeroU32,
|
||||
sync::atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
use hal::ShouldBeNonZeroExt;
|
||||
|
||||
use arrayvec::ArrayVec;
|
||||
use bitflags::Flags;
|
||||
use smallvec::SmallVec;
|
||||
use wgpu_sync::atomic::{AtomicBool, Ordering};
|
||||
use wgpu_sync::OnceCell;
|
||||
use wgt::{
|
||||
math::align_to, ColorWrites, DeviceLostReason, TextureFormat, TextureSampleType,
|
||||
@@ -66,10 +66,7 @@ use super::{
|
||||
ENTRYPOINT_FAILURE_ERROR, ZERO_BUFFER_SIZE,
|
||||
};
|
||||
|
||||
#[cfg(supports_64bit_atomics)]
|
||||
use core::sync::atomic::AtomicU64;
|
||||
#[cfg(not(supports_64bit_atomics))]
|
||||
use portable_atomic::AtomicU64;
|
||||
use wgpu_sync::atomic::AtomicU64;
|
||||
|
||||
pub(crate) struct CommandIndices {
|
||||
/// The index of the last command submission that was attempted.
|
||||
|
||||
Reference in new issue
Block a user