ID3D12Device::CopyDescriptorsSimple method (d3d12.h)

Copies descriptors from a source to a destination.

Syntax

void CopyDescriptorsSimple(
  [in] UINT                        NumDescriptors,
  [in] D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
  [in] D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
  [in] D3D12_DESCRIPTOR_HEAP_TYPE  DescriptorHeapsType
);

Parameters

[in] NumDescriptors

Type: UINT

The number of descriptors to copy.

[in] DestDescriptorRangeStart

Type: D3D12_CPU_DESCRIPTOR_HANDLE

A D3D12_CPU_DESCRIPTOR_HANDLE that describes the destination descriptors to start to copy to.

The destination and source descriptors must be in heaps of the same D3D12_DESCRIPTOR_HEAP_TYPE.

[in] SrcDescriptorRangeStart

Type: D3D12_CPU_DESCRIPTOR_HANDLE

A D3D12_CPU_DESCRIPTOR_HANDLE that describes the source descriptors to start to copy from.

Important

The SrcDescriptorRangeStart parameter must be in a non shader-visible descriptor heap. This is because shader-visible descriptor heaps may be created in WRITE_COMBINE memory or GPU local memory, which is prohibitively slow to read from. If your application manages descriptor heaps via copying the descriptors required for a given pass or frame from local "storage" descriptor heaps to the GPU-bound descriptor heap, then use shader-opaque heaps for the storage heaps and copy into the GPU-visible heap as required.

[in] DescriptorHeapsType

Type: D3D12_DESCRIPTOR_HEAP_TYPE

The D3D12_DESCRIPTOR_HEAP_TYPE-typed value that specifies the type of descriptor heap to copy with. This is required as different descriptor types may have different sizes.

Both the source and destination descriptor heaps must have the same type, else the debug layer will emit an error.

Return value

None

Remarks

Where applicable, prefer this method to ID3D12Device::CopyDescriptors. It can have a better CPU cache miss rate due to the linear nature of the copy.

Requirements

Requirement Value
Target Platform Windows
Header d3d12.h
Library D3D12.lib
DLL D3D12.dll

See also

Copying Descriptors

ID3D12Device