Skip to main content

concinnity_core/render/
feedback.rs

1//! The render half's per-frame report back to the simulation: the sampled
2//! window input, the frame's render stats, what the snapshot's op replay
3//! produced, and the consumed snapshot returned for buffer reuse. The
4//! counterpart of `RenderSnapshot` on the pipelined driver's return channel.
5
6use crate::gfx::profile::RenderStats;
7use crate::render::input::InputPacket;
8use crate::render::ops::ReplayOutcome;
9use crate::render::snapshot::RenderSnapshot;
10
11/// One frame's results crossing from the render half to the simulation.
12pub struct FrameFeedback {
13    /// Window input sampled right after the draw (whose event pump produced
14    /// it), destined for the simulation's input mailbox.
15    pub input: InputPacket,
16    /// The drawn frame's backend stats, for the profiler surfaces.
17    pub render_stats: RenderStats,
18    /// What the frame's op replay produced (failures to roll back, memory
19    /// pressure from an upload).
20    pub replay: ReplayOutcome,
21    /// The consumed snapshot, returned so its buffers keep their capacity.
22    pub recycled: RenderSnapshot,
23    /// The render half stopped (window closed, frame policy shutdown, device
24    /// lost); the simulation must stop too.
25    pub stop: bool,
26}
27
28// The feedback must stay owned data so it can cross the thread boundary.
29const _: () = {
30    const fn require_send<T: Send + 'static>() {}
31    require_send::<FrameFeedback>()
32};