Graphics Reference
In-Depth Information
Figure 2.23. A texture resource with texture slices.
Texture resource arrays. Several types of texture resources can also be created as an array
of textures. For example, a single 2D texture can be created as an array of 2D texture sub-
resources. This allows a single resource to contain what are referred to as many individual
texture slices. This is shown in Figure 2.23.
When a resource is created as an array, each of the individual texture slices can be
selected with a resource view and used as if it were a standalone resource. This allows the
texture resources to be used as a higher-level data structure that encapsulates multiple dif-
ferent contents in each texture slice. For example, having access to multiple texture slices
can simplify some forms of texture atlases, which are essentially a texture resource that
contains multiple individual textures. Texture atlases can then be used for multiple object
renderings, which allows them to be rendered consecutively without modifying the pipe-
line state in between draw calls. Having access to an array-based resource significantly
simplifies this type of technique.
Texture arrays can be created for 1D and 2D texture types, as well as the texture cube
type (which is a form of 2D texture array), but which is not allowed for 3D textures. In
practice, this limitation is not really a problem, since having an array of 3D textures would
essentially be representing a 4D data resource. The memory consumption of such a re-
source would grow extremely quickly with the resource size in each dimension. However,
if such a data structure is needed, the application can simply use multiple individual 3D
texture resources or can simply create a 3D texture where the third dimension is specified as
a multiple of basic record size and can manually be indexed by a shader program, or imple-
mented with a series of resource views that select appropriate subregions of the resource.
Search WWH ::




Custom Search