OpenVDB 13.0.1
Loading...
Searching...
No Matches
MaskPrefixSum.h File Reference

Bit-parallel inclusive prefix-sum over a NanoVDB Mask<3>. More...

#include <nanovdb/NanoVDB.h>

Go to the source code of this file.

Namespaces

namespace  nanovdb
namespace  nanovdb::util

Functions

template<bool Invert = false>
void buildMaskPrefixSums (const Mask< 3 > &mask, uint64_t prefixSum, uint16_t offsets[512])
 Compute the 512-entry inclusive prefix-sum table for a NanoVDB Mask<3> leaf, optionally over the inverted mask.

Detailed Description

Bit-parallel inclusive prefix-sum over a NanoVDB Mask<3>.

Author
Efty Sifakis
Date
March 23, 2026

Computes a 512-entry uint16_t table where entry i holds the inclusive prefix popcount of the leaf's valueMask up to and including voxel i. That is:

offsets[i] = number of active voxels at positions 0..i (inclusive)

The function is intentionally CPU-only; a GPU equivalent would look fundamentally different and is not provided here.