Graphics Reference
In-Depth Information
Figure 3.79. The conceptual splitting of the pipeline with MRTs and array-based resources.
number of render targets. However, render target array resources have several advantages,
as well. In a sense, we can say that MRT configurations use the same rasterization for all
of their render targets. This means that if a triangle is rasterized to the upper-right-hand
corner of a render target, then it will appear in the same location for all of the render tar-
gets that are written to. Render target arrays each use an individual rasterization that can
be customized, based on the SV_RenderTargetArrayIndex system value semantic. This
allows different view transformations to be used for the geometry before rasterization, and
thus also allows primitives to be rasterized to different locations within the render targets.
We can think of these two configurations as splitting the pipeline to ultimately write
to multiple render targets, but they split it in different locations. The MRT configura-
tions split the pipeline at the pixel shader stage, while array-based configurations split the
pipeline prior to the rasterizer stage. Both configurations can be useful in different situa-
tions, depending on what type of pipeline output is needed. This difference is depicted in
Figure 3.79.
There is still another facet to consider regarding the binding of render and depth
stencil targets. We mentioned above that these resources are bound with resource views—
RTVs and DSVs. Since a subresource of a resource can be specified by a resource view, it
is possible to have a larger resource bound to the pipeline through a resource view that
works with a smaller portion of that resource. When this is considered along with all of
the other options and configurations mentioned above, the developer has a large variety
of different options available to create specialized rendering algorithms.
Binding render targets. Both the render targets and the depth stencil target are bound
to the output merger in a single device context method call. The ID3DllDeviceContext
::OMSetRenderTargets() method (shown in Listing 3.27) takes a pointer to an array of
pointers to render target views and a pointer to a depth stencil view in addition to an inte-
ger specifying the number of targets in the array. The pipeline will hold a reference to the
Search WWH ::




Custom Search