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§
- Ambient
Config - Ambient visualization configuration.
- Camera
- Camera for world-to-screen projection.
- Pixel
Readback - Readback result with inspectable refusal/recovery evidence.
- Pixel
Receipt - Bounded evidence for a pixel readback. Pixel bytes are deliberately omitted.
- Screen
Point - Screen-space point (2D coordinates in physical pixels).
- Vec3
- 3D vector for world-space coordinates.
- WebGpu
Adapter Report - Adapter identity and the small capability subset relevant to this renderer.
- WebGpu
Capability Report - Capability evidence that does not contain GPU handles or unbounded data.
- WebGpu
Feature Report - Stable, bounded feature facts exposed to native and browser callers.
- WebGpu
Limit Report - Stable device limits needed to reason about the offscreen acceptance slice.
- WebGpu
Runtime Receipt - Runtime evidence returned by a renderer after a pixel acceptance attempt.
- Wgpu
Renderer - WGPU-based renderer implementation.
Enums§
- Pixel
Format - The only pixel format owned by this acceptance slice.
- Pixel
Receipt Status - A fixed-size, deterministic record of one pixel acceptance attempt.
- WebGpu
Status - 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 withinMAX_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
fnv1a64used 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 withinMAX_OFFSCREEN_DIMENSIONandMAX_PIXEL_READBACK_BYTES. - render_
preview_ data_ uri - Same preview as
render_preview_png, returned as adata: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 adata: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_BYTESbytes.