Skip to main content

RenderStats

Struct RenderStats 

Source
pub struct RenderStats {
Show 26 fields pub layers_painted: u32, pub cache: CacheStats, 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 数

§cache: CacheStats

0.6 M3 / DT-06:layer cache hit/miss、失效归因、显存高水位与恢复耗时。 采集关闭时整块恒 0(读成「未量到」,不是「没有失效」)。

§segments: u32

实际提交的 scissor 段数

§draw_calls: u32

paint 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: u8

1=Reuse / 2=UpdateContent / 3=Recreate / 0=本帧无带元数据的声明。

§last_frame_encoder: u8

承载这次上传 copy 的 submit:1 = Pass1,2 = Pass2,0 = 本帧无真实上传

Trait Implementations§

Source§

impl Clone for RenderStats

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RenderStats

Source§

impl Debug for RenderStats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RenderStats

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RenderStats

Source§

impl PartialEq for RenderStats

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderStats

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Brush for T
where T: Clone + PartialEq + Default + Debug,

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,