Available on crate feature
preview only.Expand description
In-app profiler panel for the preview app (CPU + GPU + uploads).
The main view is a progress chart: the X axis is scene progress (0..total_sec, one bucket per logic frame) and every rendered frame writes its sample into the bucket at the current timeline position β playing, seeking or dragging the chart progressively fills (and on revisit, refreshes) the samples, so performance variation across the animation becomes visible. The chart can be clicked/dragged to seek.
CPU spans (crate::render::cpu_probe) and upload stats
(crate::render::upload_probe) work in any build; GPU pass scopes
need the profiling feature and a device with timestamp query
support. Upload strategy modes can be switched live.
StructsΒ§
- Progress
Sample π - One sampled rendering of the scene at a specific timeline position.
EnumsΒ§
- Profiler
Metric π - Metric drawn in the progress chart. Stackable metrics (
GpuPasses,CpuSpans) render as a stacked color chart when the panelβsprofiler_stackedtoggle is on, and as a plain total otherwise.
ConstantsΒ§
- PASS_
PALETTE π - Fixed palette for per-pass stacked bars, keyed by pass-label order.
FunctionsΒ§
- flatten_
scopes π - Flatten a wgpu-profiler scope tree into
(label, ΞΌs)pairs. - gpu_
timer_ πfeatures - GPU timer features requested from eframeβs device so wgpu-profiler scopes produce results (intersected with adapter support at the call site, so device creation can never fail because of them).
- pass_
color π - record_
sample π - Record the just-rendered frame into the progress-sample bucket at the
current timeline position. Called from
render_animation. - share_
bar π - ui_
cpu_ πspans - ui_
gpu_ πpasses - ui_
profiler_ πwindow - ui_
progress_ πchart - X axis = scene progress; click/drag to seek, hover for the sample values.
- ui_
stacked_ πlegend - Legend for the stacked pass/span colors.
- ui_
summary π - ui_
uploads π - x_
to_ πsec