Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/facett

facett-map/Cargo.toml

[package]
name = "facett-map"
description = "facett — geo point/line viewer + wgpu GPU vector-basemap layer (ported from katana-osm osm-viewer)"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
# Development notes, agent instructions and machine-local tooling stay in the
# repository; they are not part of the published crate.
exclude = [
    ".nornir/",
]

[features]
# `wgpu` turns on the GPU vector-basemap layer (the egui_wgpu paint callback +
# the compute-cull + indirect-draw pipeline ported from katana-osm's osm-viewer).
# OFF by default: the CPU painter draws ways as line segments + points, so a
# host with no wgpu RenderState (or no GPU) still gets a real basemap. ON gives
# the upload-once GPU fast path consumers like facett-demo / korp use.
default = []
# CONS-CORE Phase C: facett-map's GPU lane now sits on the shared L0 plumbing
# (`facett-core/wgpu`): the chunking helpers + install lifecycle + bytemuck types
# come from core, and the L0 SDF points path (`l0_points`) routes the point layer
# through core's `GpuSdfRenderer`. The `GpuMapRenderer` cull + draw_indirect line
# pipeline (cull.wgsl/draw.wgsl) is unchanged.
wgpu = ["dep:egui-wgpu", "dep:wgpu", "dep:bytemuck", "facett-core/wgpu"]
# L4: functional-status emitter passthrough (see facett-core). No-op in release.
testmatrix = ["facett-core/testmatrix"]

[dependencies]
# `web_time::Instant` for the GPU upload/blit wall clocks: `std::time::Instant::now()`
# PANICS on wasm32-unknown-unknown ("time not implemented on this platform"), measured
# 2026-09-28 in the browser on the osm3d GPU lane. Same as std on native; already in the
# graph through egui (1.1.0), so it adds no build.
web-time = "1"
facett-core = { path = "../facett-core", version = "0.3.0" }
egui = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = { workspace = true }
# GPU kernel deps (only compiled with the `wgpu` feature). Versions match the
# egui 0.34 stack (egui-wgpu 0.34 → wgpu 29), same as egui_kittest's wgpu backend.
# `default-features = false`: egui-wgpu's default list ends in `wgpu/webgl`, which
# compiles wgpu's WebGL2 backend (and `glow`) into every wasm surface that reaches
# this crate. facett renders on WebGPU (`preferred_backends()` is
# `Backends::BROWSER_WEBGPU` on wasm32), so that backend is unreachable dead weight
# in the browser download. Features are additive and unify across the graph, so it
# can only be kept out where it is switched on. The two defaults that carry weight
# are re-listed; `wgpu/default` comes from the direct `wgpu` dep below, so native
# Vulkan/Metal/DX12 are unchanged. See facett-core/Cargo.toml for the full rationale.
egui-wgpu = { version = "0.36", optional = true, default-features = false, features = [
    "fragile-send-sync-non-atomic-wasm",
    "macos-window-resize-jitter-fix",
] }
wgpu = { workspace = true, optional = true }
bytemuck = { version = "1", optional = true, features = ["derive"] }

# Polygon-with-holes / multipolygon fill tessellation (lakes-with-islands, donut
# landuse). `tessellate::triangulate`/`filled_mesh` still hand-roll the single-ring
# ear clip (byte-identical), but punching holes robustly on messy OSM geometry is
# exactly what MapBox's earcut solves; earcutr is its tiny pure-Rust port (only
# itertools + num-traits, both already offline-cached). Used only by the new
# `*_with_holes` fill path — the no-hole case never touches it.
earcutr = "0.5"

# Render PROOF (LAW #4 "non-blank render", tests/render_proof.rs): render the
# populated MapView on a wgpu framebuffer + assert the pixels aren't blank — the
# same wgpu backend facett-demo's golden snapshot uses. (facett-core is already a
# normal dep, so the `Facet` trait + Theme are in scope for the test.)
[dev-dependencies]
egui_kittest = { version = "0.36", features = ["wgpu", "snapshot"] }
image = { version = "0.25", default-features = false, features = ["png"] }
# Headless GPU validation of the pretty-line pipeline (tests/line_gpu.rs, only built
# with `--features wgpu`): request a real (lavapipe) device to prove line.wgsl
# compiles + renders AA/casing, and write the before/after PNGs. Same wgpu 29 stack.
wgpu = { workspace = true }
pollster = "1"
# Functional-status emitter for the live-GPU-line-lane proof (tests/line_gpu.rs).
# default-features off → `functional_status` is a no-op unless `testmatrix` is on.
nornir-testmatrix = { version = "0.2", default-features = false }
# `facett_core::golden` — THE before/after pixel predicate (`moved` + `MinChange`, with
# both a percent and an extent floor). The inner-miter clamp's before/after proof in
# tests/line_gpu.rs uses it instead of comparing encoded PNG bytes, which carry encoder
# state and can differ while the picture is identical. Dev-only; absent from release.
facett-core = { path = "../facett-core", version = "0.3.0", features = ["golden"] }