Graphics Reference
In-Depth Information
In the declaration of each function's input and output, a structure definition is used
to group all of the inputs and outputs together. Each attribute of the input and output struc-
tures has an associated semantic, a textual name to link two data items together between
stages. The semantic is located after the name of the attribute, following a semicolon. You
can also see the type declarations for each of the components to the left of their names, just
as you would expect from a similar declaration in C/C++.
You can see from this example that the output from the first shader function nearly
matches the input of the second function, with the exception of the vertexID parameter.
The semantic listed next to this particular parameter is SV_VertexID. In addition to the
user-defined semantic attributes shown in Listing 3.1, there is another group of parameters
that can be used by a programmable shader in its input/output signature. These are referred
to as system value semantics. They represent attributes that the runtime either generates or
consumes, depending on where they are declared, and which system value semantics are
being used. These system value semantics provide helpful information for use in HLSL
programs, and are also used to indicate required values to the pipeline. System values are
always prefixed with SV_ to indicate that they have a special significance and are not user
defined. We will see each of the system values, and how they are used in each of the pipe-
line stages, as we progress through the pipeline.
Understanding how data is supplied to the pipeline, and seeing how each pipeline
stage's states influence the type of processing that occurs, are the key to successfully using
the rendering pipeline. In the following sections we will inspect each of the pipeline stages
in great detail, in the order in which they appear within the pipeline.
3.3 Input Assembler
The input assembler stage is the first stop in the rendering pipeline. It is a fixed function
stage that is responsible for putting together all of the vertices that will be processed further
down the pipeline—hence the name. As the entry point of the pipeline, the input assembler
must create vertices that have the attributes required in the next pipeline stage, the vertex
shader. The process of assembling vertices from one or more vertex buffer resources can
actually cover a large number of different configurations, as we will see in detail later in
this section. The application provides the input assembler a road map to constructing the
vertices with a vertex layout object, which also allows for flexible strategies on the appli-
cation side when creating vertex buffer resources. The input assembler's location in the
pipeline is highlighted in Figure 3.4.
In addition to constructing the input vertices, the input assembler also determines
how those vertices are connected to one another by specifying the topology of the geom-
etry being rendered. This identifies the types of primitives or control points that define
Search WWH ::




Custom Search