Specialize the mask update for each PBVH type, simplifying hot loops, reducing reliance on complex shared state and clarifying which data is used. Expose functions to update the visibility and masks tags for a specific node. It can be helpful to call these after modifying the data to update the flags while the data is more likely to be in CPU caches.