The current strategy is to do a single pass over the data, accumulate sums and counts of finite values in the downsampled arrays for all mip levels, and to calculate the final downsampled values at the end. This requires recalculation of multiple downsampled array indices for each data value, and it may not be the most efficient approach. It may be more effective to iterate over the data once per mip, and use a simpler index calculation, especially if the same indices could be reused for multiple channels in a single pass.
The current strategy is to do a single pass over the data, accumulate sums and counts of finite values in the downsampled arrays for all mip levels, and to calculate the final downsampled values at the end. This requires recalculation of multiple downsampled array indices for each data value, and it may not be the most efficient approach. It may be more effective to iterate over the data once per mip, and use a simpler index calculation, especially if the same indices could be reused for multiple channels in a single pass.