diff --git a/Services/Compositor/SceneCompositor.cs b/Services/Compositor/SceneCompositor.cs index c5d1bfa..58249f8 100644 --- a/Services/Compositor/SceneCompositor.cs +++ b/Services/Compositor/SceneCompositor.cs @@ -32,6 +32,7 @@ public sealed class SceneCompositor private static readonly Dictionary _elementRasters = new(ReferenceEqualityComparer.Instance); private static readonly object _pasteGate = new(); private const int MaxPasteEntries = 256; + private static float[] _sxLutCache = Array.Empty(); /// /// Composite into the tier's output frame. Layer order (back → @@ -547,7 +548,11 @@ public sealed class SceneCompositor // Build horizontal LUT for scaled blit to reduce per-pixel divides var lutCount = x1 - x0 + 1; - var sxLut = new float[lutCount]; + if (_sxLutCache.Length < lutCount) + { + _sxLutCache = new float[Math.Max(lutCount, 4096)]; + } + var sxLut = _sxLutCache; var pxBase = x0 - ex; for (var xi = 0; xi < lutCount; xi++) {