Graphics Reference
In-Depth Information
Each of these resource views implies the particular semantics that its resource can
use. In addition, each type of resource view provides a number of different configuration
options that allow further specification of how a resource can be used. We will briefly dis-
cuss the semantics for each of the types of resource views, and their precise usage will be
made much clearer, in Chapter 3, "The Rendering Pipeline."
Render target views. The render target view (RTV) is used to attach a resource to receive
the output of the rendering pipeline. This means that the resource that is connected will
be written to by the pipeline, and that it will also be read from in some cases to perform
blending operations. Traditionally, a render target is a two-dimensional texture, but it is
also possible to bind other types of resources. The various configuration options for a ren-
der target view depend on the type of resource that is being bound, but include the DXGI
format of the resource, as well as various methods to select subportions of a resource to
expose to the pipeline.
Depth stencil views. A depth stencil view (DSV) is similar to a render target view in that
it is attached for receiving output from the rendering pipeline. However, it differs from the
render target view in that it represents the depth stencil buffer, instead of a color render
target. The depth stencil view resource is actively used to perform the depth and stencil
tests. This makes the attached depth stencil resource very important for the efficiency of
the pipeline. Thus, to further improve performance, the depth stencil view also exposes an
additional flag to determine if the attached resource will be written to or not. This allows a
resource to be attached as the depth stencil buffer and used for the depth stencil tests, but
at the same time to be used in a shader program with a shader resource view (the next re-
source view that we will inspect). In this configuration, both views are read-only, meaning
that the resource will not be modified by either one. With such a usage, the same resource
can be bound to the pipeline in multiple places without read/write hazards, which allows
for flexible use of the resource. If a standard use of the depth stencil buffer is needed, a
second resource view can replace the read-only one to allow writing to take place.
Shader resource views. A shader resource view (SRV) provides read access to a resource
to the programmable shader stages of the pipeline. This view corresponds to the traditional
role that a texture would play in a pixel shader—data that is read from and used in the
shader program, but it is not written to. A shader resource view can be used with all of the
different programmable shader stages.
Unordered access views. The unordered access view (UAV) provides some of the most
interesting new uses for resources in Direct3D 11. Like the shader resource view, a UAV
can be used to read information from a resource. However, it also allows the resource to
be simultaneously written to from within the same shader program. Further, the output
location is not predefined, which allows the shader program to perform scattered writes to
Search WWH ::




Custom Search