diff --git a/Sources/Windflow/Canvas.swift b/Sources/Windflow/Canvas.swift index c176c37..c9ecd93 100644 --- a/Sources/Windflow/Canvas.swift +++ b/Sources/Windflow/Canvas.swift @@ -444,38 +444,64 @@ final class Canvas { blurBloom(radius: 4) } + /// Separable box blur over the bloom buffer. + /// + /// The two passes are separate methods with explicit signatures rather than + /// index arithmetic inlined into nested closures. Written that way, the + /// expression is large enough that some Swift toolchains give up type-checking + /// it — it compiles locally and fails on CI, which is the worst way to find out. private func blurBloom(radius: Int) { - let bw = bloomW, bh = bloomH + let bw = bloomW + let bh = bloomH + let inv = 1 / Float(radius * 2 + 1) bloom.withUnsafeMutableBufferPointer { src in bloomScratch.withUnsafeMutableBufferPointer { dst in - let inv = 1 / Float(radius * 2 + 1) - for y in 0.., dst: UnsafeMutableBufferPointer, + bw: Int, bh: Int, radius: Int, inv: Float + ) { + for y in 0.., dst: UnsafeMutableBufferPointer, + bw: Int, bh: Int, radius: Int, inv: Float + ) { + for x in 0..