pub struct RenderStats {Show 25 fields
pub layers_painted: u32,
pub segments: u32,
pub draw_calls: u32,
pub scratch_bytes: u64,
pub layer_texture_bytes: u64,
pub upload_ns: u64,
pub upload_write_ns: u64,
pub last_upload_width: u32,
pub last_upload_height: u32,
pub upload_source_bytes: u64,
pub upload_active_bytes: u64,
pub upload_count: u32,
pub texture_decl_count: u32,
pub texture_reuse_count: u32,
pub texture_update_count: u32,
pub texture_recreate_count: u32,
pub stale_decl_count: u32,
pub unsynced_decl_count: u32,
pub last_frame_sequence: u64,
pub last_frame_generation: u64,
pub last_frame_age_ns: u64,
pub last_frame_synced_seq: u64,
pub last_frame_latest_seq: u64,
pub last_frame_outcome: u8,
pub last_frame_encoder: u8,
}Fields§
§layers_painted: u32本帧实际重画的 layer 数
segments: u32实际提交的 scissor 段数
draw_calls: u32paint pass + stencil mask + layer blit 的 draw 总数
scratch_bytes: u64跨 layer 复用 scratch 的总字节(MSAA + stencil + snapshot)
layer_texture_bytes: u64持久 layer resolve texture 的总字节
upload_ns: u64纹理上传段的耗时(纳秒):drain_pending_textures 那一步,也就是图片/SVG 纹理
首次注册、内容更新(queue.write_texture)与重建(device.create_texture)的全部成本。
为什么要单独一段而不是并进 paint_ns:视频每一帧都走 UpdateContent(同一张
texture_id 换内容),所以这一段是“逐帧像素进 GPU 的过路费“,与画多少 layer 无关;
2026-11-10 之前它在产品里完全不可读,于是“上传贵不贵“只能靠现场搭探针回答。
口径与 mgui_core::frame::FrameStats::COLLECTING 绑定:profiling 关着时它恒 0
(Lap 不读表),那种时候不许把 0 读成“上传不要钱“。
upload_write_ns: u64只累计真实上传分支里的 queue.write_texture(Reuse 遍历不算进单次上传成本)。
last_upload_width: u32最近一次真实上传的 write_texture 尺寸(A/B 1 生效校验:实验组应等于目标尺寸)。
last_upload_height: u32§upload_source_bytes: u64本帧真实上传的源缓冲字节数(按 stride/layout 实际参与读取的量)
upload_active_bytes: u64本帧真实上传的有效像素字节数(width * height * 4)
upload_count: u32本帧真实上传次数
texture_decl_count: u32本帧带视频帧元数据的声明数 / 三种 outcome 各多少次。
texture_reuse_count: u32§texture_update_count: u32§texture_recreate_count: u32§stale_decl_count: u32声明的 sequence 落后于 paint 时共享格最新序号的次数 ——
「PaintList 重新生成了但携带旧像素」的直接计数。
unsynced_decl_count: u32声明的元数据 synced_seq == 0 的次数(RO 从未同步过这一帧)。
last_frame_sequence: u64最近一次带帧元数据的声明:sequence / generation / 帧年龄(ns)。
帧年龄只在真实上传那一次落样本(last_frame_encoder != 0)。
last_frame_generation: u64§last_frame_age_ns: u64§last_frame_synced_seq: u64四段序号链路的第 2 / 3 / 4 段(第 1 段就是 last_frame_sequence 声明的帧号)。
last_frame_latest_seq: u64§last_frame_outcome: u81=Reuse / 2=UpdateContent / 3=Recreate / 0=本帧无带元数据的声明。
last_frame_encoder: u8承载这次上传 copy 的 submit:1 = Pass1,2 = Pass2,0 = 本帧无真实上传
Trait Implementations§
Source§impl Clone for RenderStats
impl Clone for RenderStats
impl Copy for RenderStats
Source§impl Debug for RenderStats
impl Debug for RenderStats
Source§impl Default for RenderStats
impl Default for RenderStats
impl Eq for RenderStats
Source§impl PartialEq for RenderStats
impl PartialEq for RenderStats
impl StructuralPartialEq for RenderStats
Auto Trait Implementations§
impl Forget for RenderStats
impl Freeze for RenderStats
impl Move for RenderStats
impl RefUnwindSafe for RenderStats
impl Send for RenderStats
impl Sync for RenderStats
impl Unpin for RenderStats
impl UnsafeUnpin for RenderStats
impl UnwindSafe for RenderStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.