I recently have been interested in using octrees for things like voxel cone tracing, path tracing, and maybe even ray tracing. The wall that I have stumbled upon is that I can not understand how to construct the octree structure on the GPU (Not using a compute shader). I understand how the voxelization process happens (using hardware rasterization), however, I have trouble when constructing the octree. I understand how to store the tree, but I do not know how to have enough pixels on my octree texture for when the tree needs to subdivide a node. I also can't simply create a texture that has the maximum number of nodes/pixels that there will be on a tree (i.e creating a texture that has millions of pixels when not all will be filled). According to this source https://maverick.inria.fr/Publications/2011/Cra11/CCrassinThesis_EN_Web.pdf#page=169, I don't have to define the entire texture. It states,
"Whenever a node needs to be subdivided, a set of 2 × 2 × 2 sub-nodes is 'allocated' inside a global shared node buffer pre-allocated in video memory. [...] These allocations are made through the atomic increment of a global shared counter indicating the next available page of nodes in the shared node buffer." (169)
Long story short, I do not understand this quote or how it is implemented, please help. Thank you in advance.
The game engine I use for programming this on is Unity.