Graphics Reference
In-Depth Information
Resource view requirements. Like the 1D texture resource, the 2D texture resource can
also be used with all four resource view types and can specify a subset of a resource to be
exposed by the resource view. The 2D texture provides a large variety of resource creation
options and also has a correspondingly large number of resource view configurations. We
examine each of these possibilities below.
Texture2D shader resource view. For non-array, non-multisampled 2D texture resources,
the shader resource view can select a range of mip-map levels from the resource. This
is essentially the same selection mechanism that we have seen for 1D texture resources,
except that each mip-map level is a 2D subresource, instead of 1D. This is specified in
the D3D11_TEX2D_SRV structure within D3D11_SHADER_RES0URCE_VIEW_DESC, as shown
in Listing 2.30.
struct D3D11_TEX2D_SRV {
UINT MostDetailedMip;
UINT MipLevels;
}
Listing 230. The members of the D3D11_TEX2D_SRV structure.
The starting mip-map level is specified in the MostDetailedMip parameter, and
the maximum number of mip-map levels to use is specified in the MipLevels parameter.
Figure 2.34. The various shader resource view subresource selections available for 2D texture resources.
Search WWH ::




Custom Search