Skip to main content

Module wgpu_renderer

Module wgpu_renderer 

Source
Expand description

WGPU Renderer Module

Provides WebGPU/wgpu-based rendering for both WASM and native targets. Decomposed into modular capability probe, renderer state, pipeline builders, readback, drawing, and headless scene preview submodules per AGENTS.md §0-B, while re-exporting pure camera and pixel-receipt types from etalon_render::webizen_core.

Modules§

vegetation_effects
Deterministic ambient vegetation effects shared with the native renderer.

Structs§

AmbientConfig
Ambient visualization configuration.
Camera
Camera for world-to-screen projection.
PixelReadback
Readback result with inspectable refusal/recovery evidence.
PixelReceipt
Bounded evidence for a pixel readback. Pixel bytes are deliberately omitted.
ScreenPoint
Screen-space point (2D coordinates in physical pixels).
Vec3
3D vector for world-space coordinates.
WebGpuAdapterReport
Adapter identity and the small capability subset relevant to this renderer.
WebGpuCapabilityReport
Capability evidence that does not contain GPU handles or unbounded data.
WebGpuFeatureReport
Stable, bounded feature facts exposed to native and browser callers.
WebGpuLimitReport
Stable device limits needed to reason about the offscreen acceptance slice.
WebGpuRuntimeReceipt
Runtime evidence returned by a renderer after a pixel acceptance attempt.
WgpuRenderer
WGPU-based renderer implementation.

Enums§

PixelFormat
The only pixel format owned by this acceptance slice.
PixelReceiptStatus
A fixed-size, deterministic record of one pixel acceptance attempt.
WebGpuStatus
Stable status for a renderer capability probe or pixel receipt.

Constants§

COPY_BYTES_PER_ROW_ALIGNMENT
Standard WebGPU COPY_BYTES_PER_ROW_ALIGNMENT (256 bytes).
MAX_CAPABILITY_TEXT_BYTES
Maximum UTF-8 byte length retained for adapter/driver capability strings.
MAX_OFFSCREEN_DIMENSION
Maximum dimension admitted by the bounded offscreen acceptance path.
MAX_PIXEL_READBACK_BYTES
Maximum staging allocation admitted for one synchronous pixel readback.

Functions§

bounded_capability_text
Alias for truncate_text.
bounded_offscreen_extent
Clamps (requested_width, requested_height) and halves dimensions until the row-padded readback staging footprint fits within MAX_PIXEL_READBACK_BYTES.
fnv1a64
Deterministic 64-bit FNV-1a digest over bytes.
offscreen_rgba8_bytes
Checked tightly-packed RGBA8 byte size for an offscreen target.
pixel_content_hash
Alias for fnv1a64 used for pixel readback content digests.
pixel_receipt_from_rgba8
Build deterministic pixel evidence without requiring a GPU.
probe_webgpu_capabilities
Probe the adapter/device path without constructing a renderer target.
raw_readback_bytes
Checked padded staging buffer byte size for a 256-byte row-aligned readback.
readback_layout
Returns (padded_bytes_per_row, unpadded_bytes_per_row, readback_bytes, output_bytes) when (width, height) fits within MAX_OFFSCREEN_DIMENSION and MAX_PIXEL_READBACK_BYTES.
render_preview_data_uri
Same preview as render_preview_png, returned as a data:image/png;base64,... URI for hosts that prefer inline delivery. Blocking; native-only.
render_preview_png
Render a placeholder semantic scene headlessly and return raw PNG bytes.
render_scene_data_uri
Same as render_scene_png, returned as a data:image/png;base64,... URI for hosts that prefer inline delivery. Blocking; native-only.
render_scene_png
Render a RenderScene contract headlessly and return raw PNG bytes.
render_scene_png_with_time
Render scene with time parameter for animation effects. Time is in seconds, used for pulsing/glowing animations.
render_scene_png_with_time_and_telemetry
Render scene with time parameter and telemetry for ambient visualization. Time is in seconds, used for pulsing/glowing animations. Telemetry drives the ambient particle visualization effects.
truncate_text
Truncates a capability string on a valid UTF-8 character boundary to at most MAX_CAPABILITY_TEXT_BYTES bytes.