diff --git a/wgpu/src/backend/web.rs b/wgpu/src/backend/web.rs index 8417dc39d5..299626eef1 100644 --- a/wgpu/src/backend/web.rs +++ b/wgpu/src/backend/web.rs @@ -63,19 +63,6 @@ impl From> for ObjectId { } } -#[allow(unused_variables)] -impl From<(Identified, Sendable)> for ObjectId { - fn from((id, _data): (Identified, Sendable)) -> Self { - Self::new( - // TODO: the ID isn't used, so we hardcode it to 1 for now until we rework this - // API. - core::num::NonZeroU64::new(1).unwrap(), - #[cfg(feature = "expose-ids")] - id.0, - ) - } -} - #[derive(Clone, Debug)] pub(crate) struct Sendable(T); unsafe impl Send for Sendable {} diff --git a/wgpu/src/context.rs b/wgpu/src/context.rs index 11a495aa7c..6633e61b61 100644 --- a/wgpu/src/context.rs +++ b/wgpu/src/context.rs @@ -1004,7 +1004,7 @@ pub struct ObjectId { } impl ObjectId { - const UNUSED: Self = ObjectId { + pub(crate) const UNUSED: Self = ObjectId { id: None, #[cfg(feature = "expose-ids")] global_id: None, diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index dbb8ac9100..3b98e1e1a6 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -1616,9 +1616,9 @@ impl Instance { #[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))] data: Box::new(surface), #[cfg(all(target_arch = "wasm32", not(feature = "webgl")))] - id: ObjectId::from(surface), + id: ObjectId::UNUSED, #[cfg(all(target_arch = "wasm32", not(feature = "webgl")))] - data: Box::new(()), + data: Box::new(surface.1), config: Mutex::new(None), }) } @@ -1652,9 +1652,9 @@ impl Instance { #[cfg(any(not(target_arch = "wasm32"), feature = "webgl"))] data: Box::new(surface), #[cfg(all(target_arch = "wasm32", not(feature = "webgl")))] - id: ObjectId::from(surface), + id: ObjectId::UNUSED, #[cfg(all(target_arch = "wasm32", not(feature = "webgl")))] - data: Box::new(()), + data: Box::new(surface.1), config: Mutex::new(None), }) }