wgpu-core: use wgpu-sync for atomics

This commit is contained in:
Zac Harrold authored and Connor Fitzgerald committed 2026-08-28 20:37:31 -04:00
1 parent aa9d8af9f5
commit 1098476cd0
4 files changed
+3 -12

No files matched your search

Generated
-1
View File
@@ -4795,7 +4795,6 @@ dependencies = [
"naga",
"naga-types",
"num-traits",
"portable-atomic",
"profiling",
"proptest",
"raw-window-handle",
+1 -4
View File
@@ -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
-2
View File
@@ -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" }
}
}
+2 -5
View File
@@ -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.