Skip to main content

Module profiler

Module profiler 

Source
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Β§

ProgressSample πŸ”’
One sampled rendering of the scene at a specific timeline position.

EnumsΒ§

ProfilerMetric πŸ”’
Metric drawn in the progress chart. Stackable metrics (GpuPasses, CpuSpans) render as a stacked color chart when the panel’s profiler_stacked toggle 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 πŸ”’