Say how far a detail chain reaches, for a tile's halo

radius() is the widest single pass. The chain's passes run in sequence,
so what a tile has to be grown by is their sum.
This commit is contained in:
2026-09-27 17:34:16 -04:00
parent e601bd806c
commit 1eab723c90
2 changed files with 26 additions and 6 deletions
+20
View File
@@ -559,6 +559,26 @@ impl ComposedDetail {
.max()
.unwrap_or(0)
}
/// TRACES: FR-DSP-2
/// How far the whole chain reads from the pixel it finally writes, in
/// render pixels: the halo a tile has to be grown by so that its interior
/// renders exactly as the untiled frame does.
///
/// The **sum** of the passes' reaches, not the widest of them. The passes
/// run one after another, so a pixel of the last one depends on pixels of
/// the one before it `r` away, each of which depends on pixels a further
/// `r'` away. A separable blur's two halves each reach `r` along one axis
/// and the sum over-counts them by a factor of two; that is the price of a
/// bound that is always safe, and it is paid only by export tiles.
///
/// One pixel per pass on top, for the reduced grids' bilinear taps.
pub fn reach(&self) -> u32 {
self.passes
.iter()
.map(|p| p.radius.saturating_mul(p.output_scale).saturating_add(1))
.fold(0u32, u32::saturating_add)
}
}
/// TRACES: FR-DEV-3 | FR-DSP-1
File diff suppressed because one or more lines are too long