Graphics Reference
In-Depth Information
The unordered access view provides a lesser number of available resource types
when compared to the shader resource view. However, it does provide several new options
for configuring buffer resources. As we will see later in the "Buffer Resources" section,
there are some unique types of buffers that can be created for special uses. There are addi-
tional flags in this description structure for using buffers as append and consume buffers, as
well as another flag to indicate that a built-in counter will be available in the buffer object.
2.2 Resources in Detail
Now that we have learned some of the basic principles of resources and resource views, it
is time to begin a more detailed examination of the various types of resources to see what
makes them different from one another, and what they can do. This section will introduce
each type of resource and discuss each of the available subtypes they can be used to create.
We begin with the buffer resource, exploring each of the individual types of buffers that
can be used, and their various properties. This is followed by a general discussion about
texture resources, followed by a similarly detailed discussion about the various configura-
tions and options available for each texture type. It is also important to understand the dual
nature of the resources that we are working with. They are created, released, and connected
to the pipeline at a high level in C/C++, but are also used at a much finer level of granu-
larity in the HLSL shader programs of the programmable shader stages. These two usage
paradigms are of course intertwined, as certain resource types are required for certain oper-
ations within HLSL. We will explore both sides of the resources as we progress through the
chapter. We will also explore both sides of a resources usage equation throughout this section.
2.2.1 Buffer Resources
The buffer resource type provides a one-dimensional linear block of memory for use by
Direct3D 11. A number of different configurations can be used to change the behaviors
of a buffer, but they all share this same basic linear
layout. Figure 2.7 shows a diagram of how a buffer
resource is organized.
As can be seen in Figure 2.7, a buffer's size is
measured in bytes. The elements that make up a buf-
fer can have different sizes, depending on the type
of the buffer, as well as on some specific configu-
rations for each particular buffer type. Multiplying
the number of elements by the size of each ele-
Figure2.7. The layout ofa buffer resource. ment gives the total size of the buffer. This simple
Search WWH ::




Custom Search