Currently there are three entry points to building BVH trees for mesh ata: the caches on the mesh, an older set of functions used in the mesh remap code, and a new set of functions used in some geometry nodes sampling nodes. This commit unifies their implementations and switches some functions from bit spans to index masks for representing a selection of geometry.