Graphics Reference
In-Depth Information
draw methods, the vertex and primitive streams are created in largely the same ways that
were described for basic rendering and indexed rendering. However, the vertex and primi-
tive streams are repeated for each instance of the object, except that the per-instance vertex
components are updated for each complete instance. The number of instances is deter-
mined by the parameters passed to the draw call, and the per-instance vertex components
are taken from one or more vertex buffers bound to the input assembler.
Overall, the result of using instanced rendering methods is that the vertex and prim-
itive streams are multiplied by the number of instances that are being rendered. There
are four different instanced draw calls: DrawInstanced(), DrawIndexedlnstanced(),
DrawInstancedlndirectQ, and Drawlndexedlnstancedlndirect().
Indirect draw methods. In addition to the basic, indexed, and instanced rendering meth-
ods, there is another type of draw call: indirect rendering. This technique doesn't actu-
ally modify the vertex and primitive streams, but it should be discussed here for a complete
view of the available draw methods. Instead, indirect rendering methods allow a buffer
resource to be passed as the draw call parameters. The buffer contains the required in-
put information that would normally be passed by the application. The indirect rendering
methods are DrawInstancedlndirectQ and DrawIndexedlnstancedlndirect(). As an
example, the number of vertices, the starting vertex, the number of instances, and the start-
ing instance of the Drawlnstancedlndirect() method would be contained within a buffer
resource, instead of being directly passed to the function.
The purpose of these calls is to allow the GPU to fill in a buffer, which then can control
how a draw sequence is performed. This shifts control of the draw call to the GPU instead of the
application and provides the first steps for making the GPU more autonomous in its operations.
However, indirect rendering operations don't modify the construction of the vertex and primi-
tive streams—they only modify how the draw method parameters are passed to the runtime.
Mixed rendering draw methods. As we have seen, each class of rendering operation is
not mutually exclusive of the others. The names of the draw methods typically include
several of these rendering techniques, and provide a variety of different ways to execute
the pipeline. In each of these mixed cases, the resulting vertex and primitive streams are a
mixture of the independent rendering types.
3.3.4 Input Assembler Pipeline Output
User Defined Attributes
Along with an understanding of what the input assembler can produce, and how to manipu-
late its output, we need to consider how the output streams interact with the remainder of
the pipeline. For the input assembler to produce output that is compatible with the desired
Search WWH ::




Custom Search