ID3D11DeviceContext::CopyResource Method

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

Syntax

void CopyResource(
  [in]  ID3D11Resource *pDstResource,
  [in]  ID3D11Resource *pSrcResource
);

Parameter

Rückgabewert

Returns nothing

Hinweise

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:

  • Must be different resources.
  • Must be the same type.
  • Must have identical dimensions (including width, height, depth, and size as appropriate).
  • Will only be copied. CopyResource does not support any stretch, color key, blend, or format conversions.
  • Must have compatible DXGI formats, which means the formats must be identical or at least from the same type group. For example, a DXGI_FORMAT_R32G32B32_FLOAT texture can be copied to an DXGI_FORMAT_R32G32B32_UINT texture since both of these formats are in the DXGI_FORMAT_R32G32B32_TYPELESS group.
  • Might not be currently mapped.

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 ID3D11DeviceContext::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.

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

Anforderungen

Header

D3D11.h

Bibliothek

D3D11.lib

Siehe auch

ID3D11DeviceContext

ID3D11Resource