Graphics Reference
In-Depth Information
"strip" primitive topology types, this is automatically done, since each primitive uses the
vertices immediately before it to create new primitives. In the case of indexed rendering,
the indices that reference the same vertex should be located as closely together as possible,
to ensure that the cached vertex can be reused.
3.4.4 Vertex Shader Pipeline Output
When deciding what information to include in the output vertex structure, there are some
considerations to take into account regarding how the remainder of the pipeline will be
used. Figure 3.18 shows a block diagram of the rendering pipeline.
The vertex shader stage is followed by the group of tessellation stages (the hull shader,
tessellator, and domain shader stages), then the geometry shader, and then the rasterizer
stage. Depending on which of these stages are active between the vertex shader and raster-
izer stages, different requirements must be met. If the vertex shader is connected directly
to the rasterizer stage, it must produce the final clip space position of each of the vertices
in the SV_Position system value semantic. If the tessellation stages (all three are either
active or inactive together) or the geometry shader stage is active, then it is optional for
the vertex shader to produce the clip space position. However, the last active stage imme-
diately before the rasterizer stage must provide the SV_Position system value semantic.
Similarly, if the tessellation stages are active, the vertex shader stage must provide
control points to the hull shader stage. The distinction between an output vertex and a con-
trol point really depends only on the tessellation scheme being implemented, but in both
cases the data is still produced by the vertex shader. If the tessellation stages are disabled
and the geometry shader is enabled, the vertex shader output is sent directly to the geom-
etry shader. In this scenario, the geometry shader must supply the SV_Position semantic
to the rasterizer, although it could be calculated in the vertex shader and then passed to the
geometry shader. The wide variety of options for producing just one position calculation
underscores the flexibility that the pipeline provides, and the corresponding freedom for
the developer to implement an algorithm in the most advantageous method available.
Figure 3.18. A block diagram of the rendering pipeline.
Search WWH ::




Custom Search