- Vertex Specification
- Vertex Processing
- Vertex Post-Processing
- Primitive Assembly
- Fragment Shader
- Per-Sample Processing
Primitive Assembly is the stage in the OpenGL rendering pipeline where Primitives are divided into a sequence of individual base primitives. After some minor processing, as described below, they are passed along to the rasterizer to be rendered.
Early primitive assembly
The purpose of the primitive assembly step is to convert a primitive stream into a sequence of base primitives. For example, a primitive composed of line list of 12 vertices needs to generate 11 line primitives.
The full primitive assembly step (including the processing below) will always happen after Vertex Post-Processing. However, some Vertex Processing steps require that a primitive be decomposed into a sequence of base primitives. For example, a Geometry Shader operates on each input base primitive in the primitive sequence. Therefore, a form of primitive assembly must happen before the GS can execute.
This early primitive assembly only performs the conversion to base primitives. It does not perform any of the below processing steps.
All primitives can be discarded by enabling GL_RASTERIZER_DISCARD. This prevents any primitives from being rasterized.
This is useful for testing the performance of prior rendering stages, but it is also useful to prevent rendering of primitives generated during Transform Feedback operations.
The culling of triangle primitives happens during this point in the pipeline.