Graphics Reference
In-Depth Information
When the buffer is to be filled by the GPU, it can be updated with the stream output
functionality, written to as a render target, or modified with an unordered access view. If
the buffer will be updated by the CPU, one of the standard methods for modifying its con-
tents can be used, such as the ID3D11DeviceContext: :UpdateSubresource() method,
or updated with the ID3D11DeviceContext: :CopyStructureCount() method to read the
hidden counter value from a buffer. In general, these techniques for writing to the buffer
are discussed in their respective areas of Chapter 2 and Chapter 3 and won't be repeated
here. However, if it is possible to get the data into the buffer, it can subsequently be used
to execute the pipeline.
HLSL indirect argument buffer objects. The indirect argument buffers are used as input
to the pipeline execution methods, and are hence not directly used in HLSL. As mentioned
above, there are a variety of methods for getting the parameter data into the buffer, some
of which will require resource views and must be written directly from HLSL, and some
which do not. The particular technique used will dictate if the data can be written to the
buffer through an HLSL resource object.
2.2.2 Texture Resources
As we have seen throughout the last few sections, there are a myriad of different buffer re-
sources, and many different ways to configure them for various uses. However, the buffers
are only half of the resource story. Textures provide a different concept for resources based
on the evolutionary roots of the GPU as a rendering co-processor. The term texture refers to
a memory resource that is similar in nature to an image, or image-like. This is a very loose
definition, because there is a range of different texture types, with varying dimensions,
topologies, and multisampling characteristics. These make the term image-like seem some-
what out of place, since some textures don't resemble a traditional two-dimensional image
at all. The common link between these texture resources and an image is the concept of a
pixel element, which is the same across all texture types. The pixel (or texel, as it is referred
to in textures) is the smallest data element that all textures are comprised of. Each pixel is
represented by up to four components. The format of the components varies, depending on
the function of the texture resource.
While texture resources are still blocks of memory that are made available to the
GPU (as are buffer resources), additional dedicated hardware is available for certain tex-
ture operations, which can provide greater efficiency than a corresponding operation on
a buffer. One example of this would be texture-filtering hardware in a GPU. It is simply
faster to interpolate between two neighboring data elements with a texture resource than it
is with a buffer resource, because of the additional hardware. In addition, some functions
are naturally better suited to textures, such as render targets or depth stencil targets. Since
Search WWH ::




Custom Search