Graphics Reference
In-Depth Information
Draw(...)
DrawAuto(...)
Drawlndexed(...)
DrawIndexedInstanced(...)
DrawInstanced(...)
DrawIndexedInstancedIndirect(...)
DrawInstancedIndirect(...)
Each of these methods instructs the pipeline to interpret its input data in a different
way. Each method also offers different parameters to further configure how much, and
which, input data to process. Once the pipeline execution has been initiated, the input data
specified in the draw method is processed piece by piece as it is brought into the pipeline.
One of the most important considerations when planning the work that will be per-
formed during one pipeline execution is that each of the stages (both fixed and program-
mable) has different input and output types. In addition, the semantics for using those
types have relatively large performance implications. For example, in a simple rendering
sequence we could submit four vertices to the pipeline as two triangles. This would lead to
four vertex shader invocations, which would pass their output to the rasterizer stage, which
produces a number of fragments. These fragments are then passed to the pixel shader, then
finally to the output merger. If the triangles are close to the viewer, many fragments may
be generated, causing correspondingly large number of pixel shader invocations. The num-
ber of vertices is in this case is constant, while the number of fragments depends on the
conditions of the scene. The opposite situation can also occur, where the tessellation stages
produce a variable number of vertices to be rasterized, but the object remains the same size
onscreen, and thus the number of pixels remains constant. One must consider this when
designing an algorithm, since it is critical to balancing the workload placed on the GPU.
During the actual execution of the pipeline on hardware, each individual pipeline
stage must perform its calculations as quickly as possible on the available GPU hardware.
In many cases the GPU can perform multiple types of computation at the same time in
different groups of processors. In the example above, it would be possible for the GPU to
process the first triangle and rasterize it to generate fragments. It could then use some of its
processing cores to process pixel shader invocations, and some to perform the remaining
vertex shader work. On the other hand, it could process all of the vertices first and then
switch to processing all of the fragments afterward. There is no guarantee about which or-
der the GPU will process the data in—except that it will respect the logical order presented
in the pipeline.
Search WWH ::




Custom Search