ID3D12GraphicsCommandList::OMSetRenderTargets method

Sets CPU descriptor handles for the render targets and depth stencil.

Syntax

void OMSetRenderTargets(
  UINT                              NumRenderTargetDescriptors,
  const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
  BOOL                              RTsSingleHandleToDescriptorRange,
  const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor
);

Parameters

NumRenderTargetDescriptors

Type: UINT

The number of entries in the pRenderTargetDescriptors array.

pRenderTargetDescriptors

Type: const D3D12_CPU_DESCRIPTOR_HANDLE*

Specifies an array of D3D12_CPU_DESCRIPTOR_HANDLE structures that describe the CPU descriptor handles that represents the start of the heap of render target descriptors.

RTsSingleHandleToDescriptorRange

Type: BOOL

True means the handle passed in is the pointer to a contiguous range of NumRenderTargetDescriptors descriptors. This case is useful if the set of descriptors to bind already happens to be contiguous in memory (so all that’s needed is a handle to the first one). For example, if NumRenderTargetDescriptors is 3 then the memory layout is taken as follows:

Memory layout with parameter set to true In this case the driver dereferences the handle and then increments the memory being pointed to.

False means that the handle is the first of an array of NumRenderTargetDescriptors handles. The false case allows an application to bind a set of descriptors from different locations at once. Again assuming that NumRenderTargetDescriptors is 3, the memory layout is taken as follows:

Memory layout with parameter set to false In this case the driver dereferences three handles that are expected to be adjacent to each other in memory.

pDepthStencilDescriptor

Type: const D3D12_CPU_DESCRIPTOR_HANDLE*

A pointer to a D3D12_CPU_DESCRIPTOR_HANDLE structure that describes the CPU descriptor handle that represents the start of the heap that holds the depth stencil descriptor.

Return Value

This method does not return a value.

Requirements

   
Target Platform Windows
Header d3d12.h
Library D3d12.lib
DLL D3d12.dll

See Also

ID3D12GraphicsCommandList