Files
DarkRoom/core/dr-gpu/Cargo.toml
dtourolle 44ea763c61 dr-gpu: the merge pass — warp, accumulate, resolve, chunk by chunk
merge.wgsl warps one camera-space tile into one output chunk — output
pixel to direction (the projection maths of dr_pano::projection, verbatim),
direction to the frame's camera, camera to source pixel, bilinear by hand
from four textureLoads because rgba32float is not filterable — and adds it
into a storage-buffer accumulator weighted by its distance from the
frame's edge. A resolve pass divides by the weights and packs sixteen-bit
samples at the sensor's scale with a coverage bit.

MergePass::merge drives it: bands of rows, chunks across a band, and for
each chunk only the frames whose footprint meets it, each rendered as the
source rectangle the chunk needs and nothing more. The working set is one
chunk, one tile and one band (FR-MRG-11); the frame textures are the
caller's to cache. Feathered, not seamed; gain a scalar per frame — the
blend quality is panorama.md §10's step 5, after the path writes a file.
2026-09-19 15:24:12 +02:00

83 lines
3.2 KiB
TOML

[package]
name = "dr-gpu"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
dr-types.workspace = true
# The merge's geometry (FR-MRG-10): rotations, the focal length and the
# projections, solved on proxies by dr-pano and consumed here per chunk. The
# geometry alone — no keypoint model, no runtime — which is what the
# workspace entry turns off.
dr-pano.workspace = true
dr-decode.workspace = true
dr-pipeline.workspace = true
# The watershed's pixel passes are here because they are shaders; everything
# that reasons about regions rather than pixels lives there, where it is
# testable with no adapter present. No features: this half needs neither the
# inference runtime nor the weights, and the workspace declaration defaults
# them off so that stays true.
dr-segment.workspace = true
wgpu.workspace = true
thiserror.workspace = true
log.workspace = true
bytemuck.workspace = true
# Needed outside tests: shader compilation errors are collected through an
# async error scope, which must be resolved before the pipeline is returned.
pollster.workspace = true
[dev-dependencies]
env_logger.workspace = true
# The detail stage's test consumer — a box blur that is not a develop operation
# and never reaches the panel. An abstraction with no consumers is a guess, and
# this is the one that proves the neighbourhood passes compile, ping-pong,
# encode once, and scale between a proxy and an export. A dev-dependency, so a
# shipping `dr-gpu` does not carry it.
dr-pipeline = { workspace = true, features = ["detail-probe"] }
# The film stocks, for the end-to-end test only. The library half deliberately
# does not link them: `dr-gpu` binds tables it is handed and has no opinion on
# where a stock comes from.
dr-film.workspace = true
# The local-adjustment example needs the model, which the library half of this
# crate deliberately does not: `dr-gpu` holds the shaders, and the inference
# runtime belongs to whoever is asking a question about the picture.
dr-segment = { workspace = true, features = ["semantic", "embedded-model"] }
[[example]]
name = "bench"
required-features = ["readback"]
[[example]]
name = "develop"
# No `readback` needed since S1: this writes a file, so it goes through
# `export_pixels`, which is ungated precisely because an export is not the
# round-trip AC-8 forbids.
[features]
default = []
# Exposes read_pixels outside tests. Production must not enable this.
readback = []
# Exposes `Segmentation::read_field`, which builds the region adjacency graph
# on the CPU. Separate from `readback` on purpose — see `segment.rs`. Once per
# image on a worker, not the per-frame display round-trip AC-8 forbids; still a
# full-resolution transfer, and still F3's open gap.
segment-readback = []
[[example]]
name = "segment"
required-features = ["segment-readback"]
[[example]]
name = "local"
# No `segment-readback`: this reads the *rendered* proxy back through
# `export_pixels` to feed the model, which is the ungated export path. The
# watershed, and the region-graph transfer that needs the gate, is not involved.
[[test]]
name = "masked_outputs"
# Needs the distance transform, which lives with the model half of dr-segment.
required-features = []