The Direct3D Pipeline

Values output by the last geometry stage are interpolated across the primitive with perspective-correct interpolation by default.

3.1 Rasterization pipeline (D3D11 / D3D12)

Application (CPU): vertex/index buffers, textures, constant buffers, draw calls
        │
        ▼
┌──────────────────────┐
│ Input Assembler (IA) │  fixed: reads vertices/indices, builds primitives (input layout)
├──────────────────────┤
│ VERTEX SHADER (VS)   │  per vertex: transform to clip space (SV_Position)
├──────────────────────┤
│ HULL SHADER (HS)     │  optional: per patch — tessellation factors, control points
│ Tessellator          │  fixed: generates domain points
│ DOMAIN SHADER (DS)   │  per generated vertex: position new vertices
├──────────────────────┤
│ GEOMETRY SHADER (GS) │  optional: per primitive; emit/discard primitives, stream output
├──────────────────────┤
│ Stream Output (SO)   │  optional: write primitives back to buffers
├──────────────────────┤
│ Rasterizer (RS)      │  fixed: clip, divide by w, viewport, cull, rasterize, interpolate
├──────────────────────┤
│ PIXEL SHADER (PS)    │  per pixel/sample: color (SV_Target), optional depth
├──────────────────────┤
│ Output Merger (OM)   │  fixed: depth/stencil test, blending, write render targets
└──────────────────────┘

Mesh path (SM 6.5): AMPLIFICATION SHADER (AS) → MESH SHADER (MS) → Rasterizer → PS
C
…

3.2 Shader stages & profiles

transform positions, pass data on control point + patch constant function evaluate surface position amplify/modify primitives output color/depth as_ (SM 6.5+) culling, launching mesh groups ms_ (SM 6.5+) emit vertices & primitives lib_ (SM 6.3+) DXR shaders, work graph nodes, linking rootsig_1_0, rootsig_1_1 compiled root signature blobs

3.3 Coordinate spaces & D3D conventions

D3D NDC depth is [0, 1] (OpenGL: [-1, 1]); texture UV origin is top-left; screen-space SV_Position.y grows downward.

D3D traditionally uses a left-handed view space (DirectXMath offers both XMMatrixPerspectiveFovLH and ...RH).

Default front face is clockwise (FrontCounterClockwise = FALSE).

Reversed-Z (near = 1, far = 0 with a float depth buffer and GREATER comparison) greatly improves depth precision.

Object space ──(World)──► World space ──(View)──► View space ──(Projection)──► Clip space
   ──(÷ w)──► NDC: x,y ∈ [-1, 1], z ∈ [0, 1] ──(Viewport)──► Screen (pixels, origin top-left)

3.4 Rasterization & interpolation

Values output by the last geometry stage are interpolated across the primitive with perspective-correct interpolation by default. Modifiers (nointerpolation, linear, noperspective, centroid, sample) control this (see §9.4). Pixel shaders run in 2×2 quads so derivatives (ddx/ddy) and mip selection work; edge pixels outside the triangle run as helper lanes.