Skip to main content

Crate cranpose_render_wgpu

Crate cranpose_render_wgpu 

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

pipeline_disk_cache

Structs§

CapturedFrame
CPU-readable RGBA frame captured from the renderer output.
DebugToggle
A debug toggle cached until an override changes. Unset values can be read without acquiring the cache lock.
GpuPassTimingEntry
One label’s aggregate inside the current print window.
GpuPassTimingReport
GPU time by pass label, aggregated since the last [GPU-PASS] print.
HitRegion
PresentTimings
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 in RenderReturns so 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.
RenderStatsSnapshot
Scene
WgpuRenderer
WGPU-based renderer for GPU-accelerated 2D rendering.
WgpuTextSystem

Enums§

ClickAction
PublishOutcome
What WgpuRenderer::publish_frame did.
WgpuRendererError

Functions§

clear_to_default_background
Clears view to the framework’s default background and submits the work, through the same WgpuFrameGraph every other command encoder and submission in this crate is required to go through (enforced by render_contract.rs’s wgpu_command_buffers_are_owned_by_frame_graph_executor) — a fresh, one-shot WgpuFrameGraphExecutor, 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 call wgpu::SurfaceTexture::present themselves, 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 behind CRANPOSE_GPU_PASS_TIMING. Every platform’s request_device passes 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. role names 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.