Graphics Reference
In-Depth Information
while creating the input layout lowers the amount of validation required at runtime when a
shader is used with a particular input layout.
Primitive Topology
The final state that must be set in the input assembler is the primitive topology. We can view
the work of the input assembler as two tasks—first, it must assemble the vertices from the
provided input resources, using the input layout object; and second, it must organize that
vertex stream into a stream of primitives. Each primitive uses a small sequential group of
vertices (with the sequence determined either by their order of appearance in the vertex
buffers, or by the order of the indices in the index buffer for indexed rendering) to define
the components that make it up. Common examples of primitive topology are triangle lists,
triangle strips, line lists, and line strips. In the example of a triangle list, a primitive is cre-
ated for every three vertices in the vertex stream.
The primitive topology setting tells the input assembler how to build the various prim-
itives from the assembled vertex stream. The number of vertices used in each primitive, as
well as how they are selected from the assembled vertex stream, is a function of the primi-
tive topology setting. The available primitive types are provided in Listing 3.6, along with
a demonstration of how to set the primitive topology with the ID3DllDeviceContext::
IASetPrimitiveTopology() method.
enum D3D11_PRIMITIVE_T0P0L0GY {
D3Dll_PRIMITIVE_T0POL0GY_UNDEFINED,
D3D11_PRIMITIVE_T0P0L0GY_P0INTLIST,
D3D11_PRIMITIVE_T0P0L0GY_LINELIST,
D3D11_PRIMITIVE_T0P0L0GY_LINESTRIP,
D3D11_PRIMITIVE_T0P0L0GY_TRIANGLELIST ,
D3D11_PRIMITIVE_T0P0L0GY_TRIANGLESTRIP,
D3D11_PRIMITIVE_T0P0L0GY_LINELIST_ADJ,
D3D11_PRIMITIVE_T0P0L0GY_LINESTRIP_ADJ,
D3D11_PRIMITIVE_T0P0L0GY_TRIANGLELIST_ADJ,
D3D11_PRIMITIVE_T0P0L0GY_TRIANGLESTRIP_ADJ,
D3D11_PRIMITIVE_T0P0L0GY_1_C0NTR0L_P0INT_PATCHLIST,
D3D11_PRIMITIVE_TOP0LOGY_2_CONTROL_POT.NT_PATCHLTST ,
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
D3Dll_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_T0P0L0GY_6_C0NTR0L_P0T.NT_PATCHLTST ,
D3D11_PRIMITIVE_T0P0L0GY_7_C0NTR0L_P0INT_PATCHLIST,
D3D11_PRIMITIVE_T0P0L0GY_8_C0NTR0L_P0INT_PATCHLIST,
D3D11_PRIMITIVE_T0P0L0GY_9_C0NTR0L_P0INT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_T0P0L0GY_11_C0NTR0L_P0INT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_T0P0L0GY_14_C0NTR0L_P0INT_PATCHLIST,
Search WWH ::




Custom Search