Skip to main content
Changes the currently bound descriptor heaps that are associated with a command list.

Syntax

Parameters

NumDescriptorHeaps
Type: UINT
Number of descriptor heaps to bind. ppDescriptorHeaps
Type: [in] ID3D12DescriptorHeap*
A pointer to an array of ID3D12DescriptorHeap objects for the heaps to set on the command list. You can only bind descriptor heaps of type D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV and D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER. Only one descriptor heap of each type can be set at one time, which means a maximum of 2 heaps (one sampler, one CBV/SRV/UAV) can be set at one time.

Return value

Type: void None.

Remarks

SetDescriptorHeaps can be called on a bundle, but the bundle descriptor heaps must match the calling command list descriptor heap. For more information on bundle restrictions, refer to Creating and Recording Command Lists and Bundles. All previously set heaps are unset by the call. At most one heap of each shader-visible type can be set in the call. Changing descriptor heaps can incur a pipeline flush on some hardware. Because of this, it is recommended to use a single shader-visible heap of each type, and set it once per frame, rather than regularly changing the bound descriptor heaps. Instead, use ID3D12Device::CopyDescriptors and ID3D12Device::CopyDescriptorsSimple to copy the required descriptors from shader-opaque heaps to the single shader-visible heap as required during rendering.

Examples

The D3D12Bundles sample uses ID3D12GraphicsCommandList::SetDescriptorHeaps as follows:
See Example Code in the D3D12 Reference.

Requirements

Header: d3d12_xs.h or d3d12_x.h
Library: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family

See Also

Descriptor Heaps ID3D12GraphicsCommandList
Last modified on August 20, 2026