Geometry shaders versus vertex shaders
Although geometry shaders transform vertices in a very similar way than vertex shaders do, we have to enumerate some important differences between them:
Vertex shaders are executed once by an incoming vertex. Geometry shaders are executed once (by default) by an incoming primitive.
Vertex shaders can't access any information about adjacent vertices. A geometry shader has all the information for a given primitive and adjacent ones.
Vertex shaders don't produce new vertices. Geometry shaders create new primitives (in fact, that's the main purpose).
In addition, there are other facts about geometry shaders that must be known:
The geometry shader stage happens after the primitive assembly stage.
A geometry shader receives assembled primitives. This means that it doesn't matter if you send triangles, triangle strips, or fans of triangles. A geometry shader will always receive a triangle. The same happens with lines, line strips, or line loops. The primitives that...