ID3D11ComputeContextX::CopyResource Method

Copy the entire contents of the source resource to the destination resource using the GPU.

Syntax

public:
void CopyResource(
         ID3D11Resource *pDstResource,
         ID3D11Resource *pSrcResource,
         UINT CopyFlags
)  

Parameters

pDstResource
Type: ID3D11Resource *

[in] A pointer to the destination resource (see ID3D11Resource).

pSrcResource
Type: ID3D11Resource *

[in] A pointer to the source resource (see ID3D11Resource).

CopyFlags
Type: UINT 

[in] Currently ignored. A D3D11_COPY_FLAGS-typed value that specifies how to perform the copy operation. If you specify zero for no copy option, CopyResource behaves like CopySubresourceRegion. For existing display drivers that can’t process these flags, the runtime doesn’t use them.

Return value

None.

Remarks

This method is unusual in that it causes the GPU to perform the copy operation (similar to a memcpy by the CPU). As a result, it has a few restrictions designed for improving performance. For instance, the source and destination resources:

CopyResource only supports copy; it does not support any stretch, color key, or blend. CopyResource can reinterpret the resource data between a few format types. For more info, see Format Conversion using Direct3D 10.1.

You cannot use an Immutable resource as a destination. You can use a depth-stencil resource as either a source or a destination. Resources created with multisampling capability (see DXGI_SAMPLE_DESC) can be used as source and destination only if both source and destination have identical multisampled count and quality. If source and destination differ in multisampled count and quality or if one is multisampled and the other is not multisampled the call to CopyResource fails.

The method is an asynchronous call which may be added to the command-buffer queue. This attempts to remove pipeline stalls that may occur when copying data. For more info, see performance considerations.

An application that only needs to copy a portion of the data in a resource should use CopySubresourceRegion instead.

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3D11ComputeContextX Interface

ID3D11ComputeContextX Members