World Code Z
Z-Buffering is now the universal solution to Visible Surface Determination. When rendering each pixel is checked against the existing depth value. If the current pixel is further away the pixel is rejected, otherwise it is shaded and it's depth value will replace the one in the z-buffer. So drawing things closer to the camera first lowers the amount of pixel shader work that need to be done.
The Z Tests
There are up to three tests Z-test running at a GPU depending on settings. The last one is the common one talked about when describing a rendering pipeline. The two other exist to reject any extra unneccesery work as soon as possible
The GPU split up the Z-buffer in tiles and for each tile it keep track of the depth value. It makes it possible to use it as a low resolution depth buffer so it does not have to touch the real depth buffer unless a triangle has a chance to pass the depth test.
Normally the depth test is run after the pixel shader. With Early-Z the GPU can run the test before executing the pixel shader. The upside of this is the ability to skip running what can be a expensive pixel shader unless it needs to. Early-Z only works if one avoids modifying the z value in the pixel shader. Early-Z is used in Z pre-pass.
This is the depth test run after pixel shaders has run.
This is reduce the bandwidth used when reading and writing to the depth buffer. It splits the buffer into tiles and track the state as cleared, compressed or uncompressed.
Fast Z Clear
When using Z Compression the buffer can be cleared quicly by setting all tiles to cleared.
Depth - 2020
Hierarchical Depth Buffers - 2020
Depth Precision Visualized - 2015
Creating Vast Game Worlds - 2012
Depth in-depth - 2012
Know your Z - 2010
Attack of the depth buffer - 2010
A couple of notes about Z - 2009