import { World } from "koota"; //#region src/ecs/systems/batchSortSystem.d.ts /** * Create a batch-sort system bound to its own scratch buffers. * * Each SpriteGroup constructs one; the returned function is called per * frame with the world to sort. Scratch state lives in this closure * so multiple SpriteGroups don't share buffers (each world gets clean * state and resizes its own arrays independently). * * Re-sorts batch instance rows by zIndex. * * Sort-dirty signal comes from each `SpriteBatch._sortDirty` boolean, * flipped by `Sprite2D.zIndex` setter (non-gated batches only) and by * `batchAssignSystem` on new sprite insertion. Replaces the prior * `Changed(SpriteZIndex)` channel — Koota's Changed tracker enumerated * every zIndex flip every frame even when the batch's material gate * trivially skipped the sort, costing ~7ms/frame at 12k sprites with * alphaTest. The per-batch boolean is the minimum information needed. * * Skips batches whose material opts into GPU depth ordering via * `alphaTest > 0 && depthWrite`. Those materials rely on the GPU depth * test (with the layer/zIndex-derived Z baked into the instance matrix * by transformSyncSystem) and don't need CPU-side sorting. * * Zero-alloc per frame: scratch arrays in closure are reused frame to * frame, growing to the high-water mark of the largest mesh seen. */ declare function createBatchSortSystem(): (world: World) => void; //#endregion export { createBatchSortSystem }; //# sourceMappingURL=batchSortSystem.d.ts.map