diff --git a/crates/bevy_render/src/view/window/mod.rs b/crates/bevy_render/src/view/window/mod.rs index 4c324c21933ee..2f2a52fafb10f 100644 --- a/crates/bevy_render/src/view/window/mod.rs +++ b/crates/bevy_render/src/view/window/mod.rs @@ -28,10 +28,6 @@ use screenshot::{ use super::Msaa; -/// Token to ensure a system runs on the main thread. -#[derive(Resource, Default)] -pub struct NonSendMarker; - pub struct WindowRenderPlugin; impl Plugin for WindowRenderPlugin { @@ -440,7 +436,9 @@ pub fn need_new_surfaces( pub fn create_surfaces( // By accessing a NonSend resource, we tell the scheduler to put this system on the main thread, // which is necessary for some OS's - #[cfg(any(target_os = "macos", target_os = "ios"))] _marker: Option>, + #[cfg(any(target_os = "macos", target_os = "ios"))] _marker: Option< + NonSend, + >, windows: Res, mut window_surfaces: ResMut, render_instance: Res,