Graphics Reference
In-Depth Information
layer is interpreted as a separate array element. The subset of the resource to be bound with
the render target view is specified in the D3D11_TEX3D_RTV structure within the D3D11_
RENDER_TARGET_VIEW_DESC structure, as shown in Listing 2.45. This selection range is
exactly the same as the one shown for the unordered access views above, so we will not
repeat the description here.
struct D3D11_TEX3D_RTV {
UINT MipSlice;
UINT FirstWSHce;
UINT WSize;
}
Listing 2.45. The members of the D3D11_TEX3D_RTV structure.
Texture3D depth stencil view. As mentioned above, the 3D texture cannot be used with the
depth stencil view. Instead, a 2D texture array resource should be used in conjunction with
a 3D texture render target.
HLSL objects. The 3D texture objects are used in shader programs in the same way that
we have seen for 1D and 2D texture types. There are significantly fewer resource objects
available for declaration and use, which corresponds to the reduced selection of resource
view configurations. The shader resource view and the unordered access views can both be
bound to a single matching resource object. The available objects are listed below.
Texture3D
RWTexture3D
By now it should be clear which of these objects can be used with the read-only
shader resource view (Texture3D), and which can be used with the unordered access view
(RWTexture3D). The declaration syntax for each of these resource types is similar to the
other examples we have seen in the 1D and 2D cases. Several examples are provided in
Listing 2.46. The detailed usage of these objects is described in depth in Chapter 6.
Texture3D<f!oat4> tex01;
RWTexture3D<uint3> tex02;
Listing 2.46. Sample HLSL resource object declarations for 3D texture resources.
Search WWH ::




Custom Search