Skip to main content

StageId

Enum StageId 

Source
pub enum StageId {
Show 17 variants EventDispatch, Layout, AfterFrame, RenderPrepare, CommandGen, CpuRaster, Upload, BackendSubmit, PixelConvert, ImageAlloc, PixelCopy, CanvasBlit, PresentBlocking, AfterPresent, GpuExecute, Compositor, TotalFrame,
}
Expand description

全部阶段标识。

枚举而不是字符串:拼错会被编译器挡住,且 StageTimes 的 set/get 可以穷尽匹配。

Variants§

§

EventDispatch

事件分发(含命令处理、idle、动画推进、主题切换)。

§

Layout

布局。

§

AfterFrame

after_frame 钩子。

§

RenderPrepare

渲染准备(脏区规划、批次构建、清屏、实例缓冲 arrnge 等 CPU 侧准备)。

§

CommandGen

命令生成(UiTree::render 把控件调用变成后端命令)。

§

CpuRaster

CPU 光栅化(软渲染:命令生成与像素执行在同一调用里,不可分离)。

§

Upload

上传(图集/纹理;X11 上“上传 + Present“合并计入此项)。

§

BackendSubmit

后端提交(D3D11:CB 更新 + 实例缓冲 Map/memcpy + draw + blit)。

§

PixelConvert

BGRA→RGBA 转换(仅 Web)。

§

ImageAlloc

ImageData 分配(仅 Web)。

§

PixelCopy

像素批量拷贝(仅 Web:wasm → JS 堆)。

§

CanvasBlit

Canvas putImageData 调用(仅 Web,不含浏览器合成)。

§

PresentBlocking

阻塞式上屏调用(D3D11 Present / GDI blit;含 vsync 等待,不含合成器)。

§

AfterPresent

after_present 钩子。

§

GpuExecute

GPU 执行(本阶段不可测:需要新增 D3D11 timestamp query)。

§

Compositor

合成器(DWM / X server / 浏览器;在我们返回之后异步发生)。

§

TotalFrame

整帧(工作耗时,不含 wait_events 等待)。

Implementations§

Source§

impl StageId

Source

pub const ALL: [StageId; 17]

全部阶段,按“一帧内的自然顺序“排列(JSON 输出与遍历顺序一致)。

Source

pub fn name(self) -> &'static str

稳定标识(JSON key;改动会破坏已有 benchmark 数据,需同步改文档)。

Trait Implementations§

Source§

impl Clone for StageId

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 StageId

Source§

impl Debug for StageId

Source§

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

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

impl Eq for StageId

Source§

impl PartialEq for StageId

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 StageId

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> 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> 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> 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.