Skip to main content

Module render

Module render 

Source
Expand description

The wgpu render core — windowing-agnostic (the dual-target seam).

RenderCore::render_to_view draws a RenderScene into ANY wgpu::TextureView (MSAA 4x): shaded faces with per-face selection/hover emphasis (R17), screen-constant-width edges with occluded portions dimmed rather than dropped (R17), selected-face boundary outlines, vertex point sprites, and the world-axis helper (R20). Presentation shells stay thin:

  • headless: RenderCore::render_to_png (render-to-texture → readback → PNG bytes) — the artifact binary and R34 screenshot capture;
  • desktop: the winit shell hands the surface texture’s view here;
  • web: the wasm canvas shell does the same.

GPU buffers are retained per solid and reused while the solid’s scene revision is unchanged (R10 — reused solids keep their buffers across history reruns). Determinism (R33): same scene + camera + size + styles ⇒ the same command stream on the same device ⇒ identical PNG bytes.

Structs§

FrameParams
Everything a frame needs beyond the scene buffers.
GpuScene
A scene uploaded to GPU buffers, retained across frames; sync with RenderCore::sync_scene.
RenderCore
The window-agnostic renderer: pipelines + layouts for one color format.

Constants§

COLOR_FORMAT
Offscreen color format. Non-sRGB: the shaders encode explicitly, so the clear color’s bytes land in the PNG exactly.
SAMPLES
MSAA sample count (R7-equivalent quality).

Functions§

create_headless_device
Create a headless device: adapter picked by BREP_RENDER_ADAPTER (case-insensitive substring of the adapter name, e.g. “llvmpipe”) or wgpu’s high-performance default. Native only — the browser shell gets its device from the canvas context.