Graphics Reference
In-Depth Information
associated with each of these resource views that we have seen for buffers also hold true
for textures. However, depending on the resource dimensions and the type of resource view
being used, a subset of the resource can be specified to be visible to the resource view. This
provides the ability to manipulate only portions of a resource at a time and also allows
multiple views to reference different subresource regions of a resource. The subresource
selections are described below for each of these cases.
TexturelD shader resource view. For standard, non-array-based 1D texture resources, a
shader resource view can be used to select a range of mip-map levels and make them acces-
sible to the programmable shader stages. This gives the developer the option of either using
a complete resource, or only using a subset of it. In general, the subset range of mip-map
levels will be treated the same as a full resource by shader programs, since they are not
aware of what the resource behind the resource view actually looks like. The parameters
used to determine the subset are specified in the D3D11_TEX1D_SRV structure, which is used
as the union parameter from the D3D11_SHADER_RES0URCE_VIEW_DESC structure (which
we have seen in the "Resource Views" section earlier in this chapter). These parameters
are shown in Listing 2.20.
struct D3D11_TEX1D_SRV {
UINT MostDetailedMip;
UINT MipLevels;
}
Listing 2.20. The contents of the D3D11_TEX1D_SRV structure.
Figure 2.28. Several examples of mip-map ranges that can be selected.
Search WWH ::




Custom Search