See MountainsDemo::renderScene() in mountains.cpp.

In particular, note that the FBO that's bound at the top of this function has by default slice 0 of this->depthTex set as the depth buffer (see glFramebufferTexture2D() calls in setupFramebuffer()). That base depth buffer is rendered under "// draw terrain". Then below that, the hierarchical Z map is created in render passes under "// create Hi-Z map if necessary" by iteratively reading from level i-1 of this->depthTex and writing to level i, where i = 1..numLevels-1.