Files
DarkRoom/core/dr-gpu/Cargo.toml
T
dtourolle 1d7106c94d Apply the masks to the thumbnail and the export, not only the screen
Reported as a thumbnail bug; the export had it too, which is the serious
half. You would have exported a photograph missing every local adjustment.

Both called the unmasked `render`, and the failure is silent by
construction: the generated shader always declares the mask binding and
always emits a block per active layer, so binding the empty placeholder
multiplies each of them by zero. No error, no warning, no missing texture —
the adjustments are simply not there. From inside either path there is
nothing to see.

Every path that produces pixels now goes through one helper that binds the
array, and that is the point of it being one helper rather than three
correct call sites. The array is rasterised in source space at proxy size
and sampled through the framing map, so one array serves every output size:
a 256px thumbnail and a 24 MP export bind the same texture.

Three tests, and the first is the fault stated directly — render the same
edit with and without the array and assert they *differ*. If binding it ever
stops mattering, the masks have stopped reaching the shader. The third
checks the masked share of the frame is the same at 32px and 128px, because
"both non-empty" would pass while a mask that scaled wrongly still ruined
every thumbnail.
2026-08-22 10:38:49 +02:00

68 lines
2.3 KiB
TOML

[package]
name = "dr-gpu"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
[dependencies]
dr-types.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 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 = []