pub struct SceneReturnSender<S> { /* private fields */ }Expand description
The render-thread handle to scene_return_channel: pushes a drained
scene back for the UI thread to reclaim (Scene::reset + reuse) instead
of a shell allocating a fresh one every frame — closing the buffer-reuse
gap a scene crossing render_channel would otherwise leave (a scene
with no way back, so every split submit_frame replaced it with
Scene::new()).
Implementations§
Source§impl<S> SceneReturnSender<S>
impl<S> SceneReturnSender<S>
Sourcepub fn give_back(&self, scene: S)
pub fn give_back(&self, scene: S)
Push a drained scene back for the UI thread to reclaim. Depth-1
latest-wins, mirroring RenderSender::send_scene: an unpolled scene
already in the slot is replaced (dropped) rather than queued — the UI
thread only ever needs one spare, and an unbounded backlog here would
just be a leak-shaped wait for a UI thread that has stopped polling.
The render thread must call this for every SceneFrame it takes
off a RenderReceiver — whether the scene is actually rendered or
the frame is phase-gated out (RenderPhase::Paused/RenderPhase::NoSurface
after a Pause/SurfaceDestroyed) — so a scene is never silently
dropped instead of given back.