Graphics Reference
In-Depth Information
Figure 3.78. The output merger stage.
tests function in more detail later in this section. The location of the output merger stage is
highlighted in Figure 3.78.
The output merger is also capable of modifying the color values that are passed on
to it from the pixel shader through the blending function. This configurable functionality
allows for a variety of different blending modes, which can be used to combine the current
pixel shader results with the existing contents of the render target. This blending function-
ality, coupled with the ability to handle MSAA render targets, multiple render targets, and
render target array resources makes the output merger play an important role in producing
the final rendered image.
3.12.1 Output Merger Pipeline Input
Because it is the final stage in the pipeline, input to the output merger stage is the complete
set of data produced by the pixel shader stage. The primary input for the output merger
is the color values that were produced by the pixel shader program. The number of color
values received depends on the output signature declared in the pixel shader, but in general,
the number of output colors will match the number of render targets that have been bound to
the output merger for an MRT configuration. There is one exception to this, which is when
two colors are output from the pixel shader for use in dual-source blending. This concept is
discussed further in the blending portion of the "Output Merger Stage Processing" section.
The second major input that the output merger stage receives is the fragment's depth
value. This value is received either from the rasterizer stage, or the pixel shader stage if it
is manually modified in the pixel shader program. These depth values are the input to the
depth test, and will ultimately be used to update the depth buffer contents.
As described in the "Pixel Shader Pipeline Output" section, both of these values are
output for each subsample when MSAA is used. In this case, an additional input system
value semantic can be received from the pixel shader. The SV_Coverage semantic indicates
which subsamples will be written to by the pixel shader output. This subsample selection
process is performed automatically in the output merger stage and requires no additional
effort by the application, but it is still important to understand how the output data will
eventually end up in a render target.
Search WWH ::




Custom Search