Summary of method used for solid view in viewport

Hi, this is my first post and I have done a quick look in the dev wiki but couldn’t see much, and I haven’t looked through code at all.
I was hoping someone could briefly summarise, or point me to docs that do, how solid shading is performed in the viewport.
E.g. are edges calculated when the mesh is imported, or is there some shader work going on? Are the edges a separate rendering pass or incorporated into a pixel shader?
Many thanks for any help!