First of all, it is a mistake to assume that the vertex shader runs once per vertex. Using indexed rendering, a primitive assembly can typically access the Post T & L cache (the result of previous vertex shader calls) based on the vertex index to prevent vertex estimation more than once. However, new things, such as geometric shaders, can easily lead to its destruction.
As for how the fragment shader gets its value, which is usually done during rasterization. These per-vertex attributes are interpolated along the surface of the primitive (in this case, a triangle) based on the distance of the fragment relative to the vertices that were used to construct the primitive. In DX11, interpolation can be delayed until the fragment shader itself is executed (called pull-model interpolation), but traditionally this is what happens during rasterization.
Andon M. coleman
source share