// shared sizing constants for histogram and per-splat-mask GPU passes. // keeping them in one place stops calc-histogram, select-by-range, intersect, // and the histogram shaders from drifting independently. // histogram tile reduction grid: tile shader writes a GRID_DIM x GRID_DIM // texture, the reduce shader collapses it to 1x1. the histogram shaders // hardcode MAX_GRID_DIM=64 as the unrolled loop bound; if GRID_DIM ever // exceeds 64 the shader bound must be raised alongside it. const GRID_DIM = 64; // default bin count for histogram results when the caller does not override. const NUM_BINS = 256; // per-splat mask packing: each u32 of the output carries 4 splat bytes, so the // mask is sized from the splat count alone and carries no dependency on the // source texture's shape. all callers (Intersect, SelectByRange, ColorMatch) // agree on layout by using this helper. const maskByteSize = (count: number): number => { return Math.max(4, Math.ceil(count / 4) * 4); }; export { GRID_DIM, NUM_BINS, maskByteSize };