How is depth buffer computed by opengl ?

Is it a linear interpolation of Z Vertex coordinates ?

Is it a linear interpolation of Vertex-Origine distances ? (sqrt(X^2+Y^2+Z^2))

Is it a per-pixel Vertex-Origine distance computation ?

Or something else… ?