diff --git a/wgpu-core/src/binding_model.rs b/wgpu-core/src/binding_model.rs index 6f43ac523..55a3e145f 100644 --- a/wgpu-core/src/binding_model.rs +++ b/wgpu-core/src/binding_model.rs @@ -17,7 +17,6 @@ use crate::{ use arrayvec::ArrayVec; -use once_cell::sync::OnceCell; #[cfg(feature = "serde")] use serde::Deserialize; #[cfg(feature = "serde")] @@ -27,7 +26,7 @@ use std::{ borrow::Cow, mem::ManuallyDrop, ops::Range, - sync::{Arc, Weak}, + sync::{Arc, OnceLock, Weak}, }; use thiserror::Error; @@ -498,7 +497,7 @@ pub struct BindGroupLayout { /// We cannot unconditionally remove from the pool, as BGLs that don't come from the pool /// (derived BGLs) must not be removed. pub(crate) origin: bgl::Origin, - pub(crate) exclusive_pipeline: OnceCell, + pub(crate) exclusive_pipeline: OnceLock, #[allow(unused)] pub(crate) binding_count_validator: BindingTypeMaxCountValidator, /// The `label` from the descriptor used to create the resource. diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 5a726ef70..883703fa1 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -35,8 +35,6 @@ use crate::{ }; use arrayvec::ArrayVec; -use once_cell::sync::OnceCell; - use smallvec::SmallVec; use wgt::{ math::align_to, DeviceLostReason, TextureFormat, TextureSampleType, TextureViewDimension, @@ -48,7 +46,7 @@ use std::{ num::NonZeroU32, sync::{ atomic::{AtomicBool, AtomicU64, Ordering}, - Arc, Weak, + Arc, OnceLock, Weak, }, }; @@ -80,8 +78,8 @@ use super::{ pub struct Device { raw: ManuallyDrop>, pub(crate) adapter: Arc, - pub(crate) queue: OnceCell>, - queue_to_drop: OnceCell>, + pub(crate) queue: OnceLock>, + queue_to_drop: OnceLock>, pub(crate) zero_buffer: ManuallyDrop>, /// The `label` from the descriptor used to create the resource. label: String, @@ -266,8 +264,8 @@ impl Device { Ok(Self { raw: ManuallyDrop::new(raw_device), adapter: adapter.clone(), - queue: OnceCell::new(), - queue_to_drop: OnceCell::new(), + queue: OnceLock::new(), + queue_to_drop: OnceLock::new(), zero_buffer: ManuallyDrop::new(zero_buffer), label: desc.label.to_string(), command_allocator, @@ -1865,7 +1863,7 @@ impl Device { device: self.clone(), entries: entry_map, origin, - exclusive_pipeline: OnceCell::new(), + exclusive_pipeline: OnceLock::new(), binding_count_validator: count_validator, label: label.to_string(), };