Rasterizer (RS) stage

The rasterizer clips primitives that aren't in view, prepares primitives for the Pixel Shader (PS) stage, and determines how to invoke pixel shaders. The rasterization stage converts vector information (composed of shapes or primitives) into a raster image (composed of pixels) for the purpose of displaying real-time 3D graphics.

Purpose and uses

During rasterization, each primitive is converted into pixels, while interpolating per-vertex values across each primitive. Rasterization includes clipping vertices to the view frustum, performing a divide by z to provide perspective, mapping primitives to a 2D viewport, and determining how to invoke the pixel shader. While using a pixel shader is optional, the rasterizer stage always performs clipping, a perspective divide to transform the points into homogeneous space, and maps the vertices to the viewport.

You may disable rasterization by telling the pipeline there is no pixel shader (set the Pixel Shader (PS) stage to NULL and disable depth and stencil testing). While disabled, rasterization-related pipeline counters will not update.

On hardware that implements hierarchical Z-buffer optimizations, you may enable preloading the z-buffer by setting the Pixel Shader (PS) stage to NULL while enabling depth and stencil testing.

See Rasterization rules.

Input

Vertices (x,y,z,w), coming into the Rasterizer stage are assumed to be in homogeneous clip-space. In this coordinate space the X axis points right, Y points up and Z points away from camera.

The fixed-function Rasterizer (RS) stage is fed by the Stream Output (SO) stage and/or by the previous pipeline stage, such as the Geometry Shader (GS) stage. If GS isn't used, RS is fed by the Domain Shader (DS) stage. If DS also isn't used, RS is fed by the Vertex Shader (VS) stage.

Output

Using the Pixel Shader (PS) stage is optional; the rasterizer stage can output directly to the Output Merger (OM) stage instead.

Rasterization rules

Graphics pipeline