Graphics Reference
In-Depth Information
of a subrange of the elements of the texture array. This is done with the D3D11_TEX2DMS_
ARRAY_SRV structure within the D3D11_SHADER_RES0URCE_VIEW_DESC structure, as
shown in Listing 2.32.
struct D3D11_TEX2DMS_SRV {
UINT UnusedField_NothingToDefine;
}
struct D3D11_TEX2DMS_ARRAY_SRV {
UINT FirstArraySlice;
UINT ArraySize;
}
Listing 2.32. The members of the D3D11_TEX2DMS_SRV and D3D11_TEX2DMS_ARRAY_SRV
structures.
As we have seen before, the array range is selected with the FirstArraySlice and the
ArraySize parameters. A few examples of this range selection are shown in Figure 2.36.
There are two additional special uses for 2D texture array resources when they are
created with the D3D11_RES0URCE_MISC_TEXTURECUBE miscellaneous flag. These shader
resource views can be used to provide cube map access to six array elements, where each
element represents one face of the cube map. For single cube map shader resource views,
the D3D11_TEXCUBE_SRV structure is used. In this case, the texture array resource must
have six elements, and a subrange of each face's mip-map levels can be specified. This is
demonstrated in Listing 2.33.
struct D3D11_TEXCUBE_SRV {
UINT MostDetailedMip;
UINT MipLevels;
}
Listing 2.33. The members of the D3D11_TEXCUBE_SRV structure.
Figure 2.36. The various shader resource view subresource selections available for 2D multisampled texture array
resources.
Search WWH ::




Custom Search