Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Direct3D supports several primitive topologies, which define how vertices are interpreted and rendered by the pipeline, such as point lists, line lists, and triangle strips.
The following basic primitive topologies (or primitive types) are supported:
For a visualization of each primitive type, see the diagram later in this topic in Winding direction and leading vertex positions.
The Input Assembler (IA) stage reads data from vertex and index buffers, assembles the data into these primitives, and then sends the data to the remaining pipeline stages.
All Direct3D primitive types (except the point list) are available in two versions: one primitive type with adjacency and one primitive type without adjacency. Primitives with adjacency contain some of the surrounding vertices, while primitives without adjacency contain only the vertices of the target primitive. For example, the line list primitive has a corresponding line list primitive that includes adjacency.
Adjacent primitives are intended to provide more information about your geometry and are only visible through a geometry shader. Adjacency is useful for geometry shaders that use silhouette detection, shadow volume extrusion, and so on.
For example, suppose you want to draw a triangle list with adjacency. A triangle list that contains 36 vertices (with adjacency) will yield 6 completed primitives. Primitives with adjacency (except line strips) contain exactly twice as many vertices as the equivalent primitive without adjacency, where each additional vertex is an adjacent vertex.
As shown in the following illustration, a leading vertex is the first non-adjacent vertex in a primitive. A primitive type can have multiple leading vertices defined, as long as each one is used for a different primitive.
The following illustration shows the vertex ordering for all of the primitive types that the input assembler can produce.
The symbols in the preceding illustration are described in the following table.
Symbol | Name | Description |
---|---|---|
![]() |
Vertex | A point in 3D space. |
![]() |
Winding Direction | The vertex order when assembling a primitive. Can be clockwise or counterclockwise. |
![]() |
Leading Vertex | The first non-adjacent vertex in a primitive that contains per-constant data. |
You can generate multiple strips through strip cutting. You can perform a strip cut by explicitly calling the RestartStrip HLSL function, or by inserting a special index value into the index buffer. This value is –1, which is 0xffffffff for 32-bit indices or 0xffff for 16-bit indices.
An index of –1 indicates an explicit 'cut' or 'restart' of the current strip. The previous index completes the previous primitive or strip and the next index starts a new primitive or strip.
For more info about generating multiple strips, see Geometry Shader (GS) stage.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayDocumentation
Input Assembler (IA) stage - UWP applications
The Input Assembler (IA) stage supplies primitive and adjacency data to the pipeline, such as triangles, lines and points, including semantics IDs to help make shaders more efficient by reducing processing to primitives that haven't already been processed.
Vertex Shader (VS) stage - UWP applications
The Vertex Shader (VS) stage processes vertices, typically performing operations such as transformations, skinning, and lighting. A vertex shader takes a single input vertex and produces a single output vertex.
Pixel Shader (PS) stage - UWP applications
The Pixel Shader (PS) stage receives interpolated data for a primitive, and generates per-pixel data such as color.