Z buffer: how can i find distance between render pixel and scene object?

just for curiosity: what should be in sd inside camera_distance(kg, sd->P) and where may i find it, if you now?