Graphics Reference
In-Depth Information
Figure 2.1. The Direct3D 11 Resource Interface Hierarchy.
2.1 Resources Overview
There are two basic categories of resources in Direct3D 11: buffers and textures. Each of
these has several subtypes, and each subtype has different configuration options. The sheer
number of available options for creating resources can be somewhat overwhelming at first,
so our discussion of the topic will begin with how they are organized within the Direct3D 11
API. By starting at a high level, we can begin to understand the differences in the various
resources and then build on this knowledge with additional details about the way that these
differences determine how a resource can be used.
The Direct3D 11 resource class structure is organized as shown in Figure 2.1. Here,
you can see that there are only four resource classes available for the entire API—buffers,
and ID, 2D, and 3D textures.
The diagram also shows that each of these resource classes is derived from a single
common base class, named ID3D11Resource. This makes sense and provides an indication
of a common theme that we will be revisiting throughout this chapter. That is, the resources
are only blocks of memory that can be attached to the pipeline and used for input or output
(or in some cases, both input and output). Restated another way, resources are blocks of
memory that are made available for the GPU to use and manipulate. Even though they have
different names and support different concepts, the only real differences between them are
the semantics with which they are bound to the pipeline and the rules about their format-
ting, access, and use.
2.1.1 Resource Creation
As described in Chapter 1, "Overview of Direct3D 11," the ID3D11Device interface is
responsible for creating all memory resources. The created resources can then be attached
Search WWH ::




Custom Search