From 1879695f9b5fda11f7a7c8e6cda0ee657e49efd2 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Wed, 26 Aug 2026 16:47:08 +0200 Subject: [PATCH] Opt out of `Send + Sync` for `Global` --- wgpu-core-remote/src/global/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu-core-remote/src/global/mod.rs b/wgpu-core-remote/src/global/mod.rs index 861238837..6e515e617 100644 --- a/wgpu-core-remote/src/global/mod.rs +++ b/wgpu-core-remote/src/global/mod.rs @@ -1,6 +1,7 @@ use alloc::sync::Arc; use core::cell::RefCell; use core::fmt; +use core::marker::PhantomData; use wgpu_core::binding_model::{BindGroup, BindGroupLayout, PipelineLayout}; use wgpu_core::command::{ CommandBuffer, CommandEncoder, ComputePass, RenderBundle, RenderBundleEncoder, RenderPass, @@ -40,6 +41,7 @@ pub struct Global { pub(crate) hub: RefCell, // the instance must be dropped last pub instance: Arc, + _prevent_send_and_sync: PhantomData<*const ()>, } impl Global { @@ -51,6 +53,7 @@ impl Global { Self { instance: Instance::new(name, instance_desc, telemetry), hub: RefCell::new(Hub::new()), + _prevent_send_and_sync: PhantomData, } } @@ -58,6 +61,7 @@ impl Global { Self { instance, hub: RefCell::new(Hub::new()), + _prevent_send_and_sync: PhantomData, } }