Skip to main content

fret_core/
streaming.rs

1use crate::FrameId;
2
3/// Per-frame counters for streaming image uploads (ADR 0121).
4///
5/// This is intended for debugging/telemetry surfaces (e.g. an on-screen overlay). The runner
6/// updates it when enabled by configuration.
7#[derive(Debug, Default, Clone, Copy)]
8pub struct StreamingUploadPerfSnapshot {
9    pub frame_id: FrameId,
10
11    pub upload_budget_bytes_per_frame: u64,
12    pub staging_budget_bytes: u64,
13
14    pub update_effects_seen: u64,
15    pub update_effects_enqueued: u64,
16    pub update_effects_replaced: u64,
17    pub update_effects_applied: u64,
18    pub update_effects_delayed_budget: u64,
19    pub update_effects_dropped_staging: u64,
20
21    /// Estimated CPU->GPU upload bytes used for budget decisions this frame.
22    ///
23    /// This is computed before applying updates and may be conservative when a platform can
24    /// apply an update through a more efficient path (e.g. GPU-assisted YUV conversion).
25    pub upload_bytes_budgeted: u64,
26
27    /// Actual CPU->GPU upload bytes performed by applied updates this frame.
28    pub upload_bytes_applied: u64,
29
30    pub pending_updates: u64,
31    pub pending_staging_bytes: u64,
32
33    /// Total CPU time spent preparing YUV updates during this frame (microseconds).
34    ///
35    /// This includes CPU-side work such as plane repacking and command encoding; it does not
36    /// include GPU execution time.
37    pub yuv_convert_us: u64,
38    /// Total RGBA output bytes produced (or written) by the YUV conversion path during this frame.
39    pub yuv_convert_output_bytes: u64,
40    pub yuv_conversions_attempted: u64,
41    pub yuv_conversions_applied: u64,
42}