ID3D12GraphicsCommandList::ResolveSubresource method (d3d12.h)
Copy a multi-sampled resource into a non-multi-sampled resource.
Syntax
void ResolveSubresource(
ID3D12Resource *pDstResource,
UINT DstSubresource,
ID3D12Resource *pSrcResource,
UINT SrcSubresource,
DXGI_FORMAT Format
);
Parameters
pDstResource
Type: [in] ID3D12Resource*
Destination resource. Must be a created on a D3D12_HEAP_TYPE_DEFAULT heap and be single-sampled. See ID3D12Resource.
DstSubresource
Type: [in] UINT
A zero-based index, that identifies the destination subresource. Use D3D12CalcSubresource to calculate the subresource index if the parent resource is complex.
pSrcResource
Type: [in] ID3D12Resource*
Source resource. Must be multisampled.
SrcSubresource
Type: [in] UINT
The source subresource of the source resource.
Format
Type: [in] DXGI_FORMAT
A DXGI_FORMAT that indicates how the multisampled resource will be resolved to a single-sampled resource. See remarks.
Return value
None
Remarks
Debug layer
The debug layer will issue an error if the subresources referenced by the source view is not in the D3D12_RESOURCE_STATE_RESOLVE_SOURCE state.The debug layer will issue an error if the destination buffer is not in the D3D12_RESOURCE_STATE_RESOLVE_DEST state.
The source and destination resources must be the same resource type and have the same dimensions. In addition, they must have compatible formats. There are three scenarios for this:
Scenario | Requirements |
---|---|
Source and destination are prestructured and typed | Both the source and destination must have identical formats and that format must be specified in the Format parameter. |
One resource is prestructured and typed and the other is prestructured and typeless | The typed resource must have a format that is compatible with the typeless resource (i.e. the typed resource is DXGI_FORMAT_R32_FLOAT and the typeless resource is DXGI_FORMAT_R32_TYPELESS). The format of the typed resource must be specified in the Format parameter. |
Source and destination are prestructured and typeless | Both the source and destination must have the same typeless format (i.e. both must have DXGI_FORMAT_R32_TYPELESS), and the Format parameter must specify a format that is compatible with the source and destination (i.e. if both are DXGI_FORMAT_R32_TYPELESS then DXGI_FORMAT_R32_FLOAT could be specified in the Format parameter).
For example, given the DXGI_FORMAT_R16G16B16A16_TYPELESS format:
|
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d12.h |
Library | D3d12.lib |
DLL | D3d12.dll |