Skip to main content

Module render

Module render 

Source
Expand description

The L0 shared render kernel (CONS-CORE) — shared Camera, z-ordered LayerStack, the CPU rect scissor, and (feature wgpu) the extracted GPU scaffold. Map skins + facett-graphview draw through this. facett-core::render — the L0 shared render kernel both map skins and facett-graphview draw through (the CONS-CORE seam).

Phase A landed the pure additions ([camera], [layer], the moved scissor, the GPU scaffold). Phase B adds the net-new L0 SDF kernel + the backend-swap seam:

  • [prim] — the SDF instance vocabulary (QuadInstance/LineInstance + the Circle/Ring/Marker constructors), bytemuck-able for the GPU path.
  • [cpu] — the CPU lane: the SDF coverage math ([cpu::sdf]) + [CpuCanvas] rasterizing onto a vello_cpu pixmap, plus the moved rect scissor.
  • [gpu] (feature wgpu) — the GpuSdfRenderer: instanced quads with a fragment-shader SDF (circle/ring/marker) + thick AA instanced lines, on the Phase-A install lifecycle + bytemuck plumbing.
  • [backend] — the decide(probe) -> [Backend] policy (lifted from graphview).
  • [Canvas] / [Renderer] — the backend-swap seam traits. Both CpuRenderer and (feature wgpu) GpuSdfRenderer satisfy them.

Re-exports§

pub use backend::decide;
pub use backend::Backend;
pub use backend::GpuProbe;
pub use camera::Camera;
pub use camera::InputFeel;
pub use layer::Layer;
pub use layer::LayerKind;
pub use layer::LayerStack;
pub use prim::CircleInstance;
pub use prim::LineInstance;
pub use prim::MarkerInstance;
pub use prim::QuadInstance;
pub use prim::RingInstance;
pub use cpu::CpuCanvas;
pub use cpu::CpuRenderer;

Modules§

backend
Runtime backend selection — the galileo-style Renderer backend-swap policy, lifted into the L0 kernel from facett-graphview::backend so map skins and the graph engine decide identically. (graphview will re-export this in Phase C; this milestone just adds it to core without breaking graphview, which keeps its own copy.)
camera
The shared L0 camera — the seam where the two domain skins (map + graph) meet one navigation model. It is the superset of the two cameras that exist in the skins today:
cpu
The CPU render lane (L0 fallback).
layer
The graphs-over-maps seam — a z-ordered LayerStack.
prim
The L0 SDF instance model — the domain-agnostic primitive vocabulary both the CPU raster (super::cpu::sdf) and the GPU pipeline ([super::gpu::sdf_pipeline], feature wgpu) draw from.

Structs§

Frame
A rendered frame: straight (un-premultiplied) RGBA8, row-major, width × height. The CPU lane composites into this; the GPU lane reads it back for a parity test. Mirrors graphview’s Rendered so a skin can move over without a shape change.

Traits§

Canvas
The drawing surface — the galileo-style backend-swap seam. A host pushes SDF instance batches; the concrete canvas (CPU pixmap or wgpu callback) decides how they become pixels. Domain-agnostic: a map point, a graph node, and a POI are all just quads; a road and an edge are all lines.
Renderer
The renderer — opens a Canvas for a frame, then presents it. The 2-category swap (CPU / CPU+GPU) is expressed entirely as which Renderer the host holds; the draw code is written once against Canvas.