Graphics Reference
In-Depth Information
Resolve Subresource
The other method that can be used to generate resource content is the ID3DllDeviceContext
::ResolveSubresource() method. This is used to take a source multisampled texture
resource and use the subsamples to calculate the final color value of the corresponding
pixel in a non-multisampled destination resource. This is a required step before displaying
the contents of a multisampled render target on the screen, and hence is a vital operation
for high-quality rendered image output. In the case of a DXGI swap chain, it supports
automatically performing the resolve function during the buffer swap triggered with the
Present() method. This technically allows the application to skip the manual resolve
process in some cases, but if a multisampled render target is used as an input to any fur-
ther algorithms (such as any post-processing techniques) the render target will need to be
resolved well in advance of any per-pixel algorithms being applied to it. The prototype of
the method is shown in Listing 2.56.
void ResolveSubresource(
ID3D11Resource *pDstResource,
UINT DstSubresource,
ID3DllResource *pSrcResource,
UINT SrcSubresource,
DXGI_FORMAT Format
);
Listing 2.56. The resolve subresource method prototype.
This method allows for subresource indices to be provided for both the source and
destination resource. This also means that a complete subresource must be resolved at the
same time, and it does not allow portions of a subresource to be manipulated in isolation.
In addition, a format identifier is passed to indicate the format to be used when the two
resources have compatible TYPELESS formats.
Search WWH ::




Custom Search