Expand description
WGPU renderer backend for GPU-accelerated 2D rendering.
This renderer uses WGPU for cross-platform GPU support across desktop (Windows/Mac/Linux), web (WebGPU), and mobile Android.
Modules§
Structs§
- Captured
Frame - CPU-readable RGBA frame captured from the renderer output.
- Debug
Toggle - A debug toggle cached until an override changes. Unset values can be read without acquiring the cache lock.
- GpuPass
Timing Entry - One label’s aggregate inside the current print window.
- GpuPass
Timing Report - GPU time by pass label, aggregated since the last
[GPU-PASS]print. - HitRegion
- Present
Timings - Present-stage timestamps for one consumed packet, in nanoseconds on the
clock the producer injected at runtime start (
0= stage did not run or no clock was injected). Carried back inRenderReturnsso the producer’s frame telemetry keeps recording acquire/render/present phases after those stages move to the present thread. Plain integers so the packet types stay clock-library-free on every target. - Render
Stats Snapshot - Scene
- Wgpu
Renderer - WGPU-based renderer for GPU-accelerated 2D rendering.
- Wgpu
Text System
Enums§
Functions§
- clear_
to_ default_ background - Clears
viewto the framework’s default background and submits the work, through the sameWgpuFrameGraphevery other command encoder and submission in this crate is required to go through (enforced byrender_contract.rs’swgpu_command_buffers_are_owned_by_frame_graph_executor) — a fresh, one-shotWgpuFrameGraphExecutor, since a placeholder clear has no frame-to-frame state worth pooling. Does not present or acquire anything itself — callers that mean to show the clear on screen still acquire a frame and callwgpu::SurfaceTexture::presentthemselves, exactly as a real content frame would. - composition_
bytes_ per_ pixel - Bytes one pixel of the renderer’s composition format occupies.
- frames_
presented - headless_
text_ measurer - Create an accurate WGPU text measurer for headless tests without launching a window.
- headless_
text_ measurer_ with_ fonts - Create an accurate WGPU text measurer for headless tests with explicit fonts.
- optional_
device_ features - The optional device features the renderer exploits when the adapter
offers them: pipeline caching (see
pipeline_disk_cache) and the timestamp queries behindCRANPOSE_GPU_PASS_TIMING. Every platform’srequest_devicepasses this so a profiling toggle never needs a rebuilt binary; intersecting with the adapter’s own features keeps the request valid on adapters without them. - pin_
current_ thread_ to_ fast_ cores - Restricts the calling thread to the fast-capacity CPUs, when the
machine has distinguishable ones.
rolenames the thread in the log line so an A/B trace shows who pinned where. - pipelines_
created - pipelines_
created_ off_ frame - Pipelines built away from every frame, on the compiler thread.
- presentable_
root_ usages - The usages a presentable image needs to serve as the frame’s root target: rendering plus the capture usages the composition target has. Callers configuring a surface ask for them when the surface offers them all; a partial set falls back to the composition copy, so nothing is requested in that case beyond rendering.