ID3D12Device::CreateRenderTargetView method

Creates a render-target view for accessing resource data.

Syntax

void CreateRenderTargetView(
  ID3D12Resource                      *pResource,
  const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
  D3D12_CPU_DESCRIPTOR_HANDLE         DestDescriptor
);

Parameters

pResource

Type: ID3D12Resource*

A pointer to the ID3D12Resource object that represents the render target.

At least one of pResource or pDesc must be provided. A null pResource is used to initialize a null descriptor, which guarantees D3D11-like null binding behavior (reading 0s, writes are discarded), but must have a valid pDesc in order to determine the descriptor type.

pDesc

Type: const D3D12_RENDER_TARGET_VIEW_DESC*

A pointer to a D3D12_RENDER_TARGET_VIEW_DESC structure that describes the render-target view.

A null pDesc is used to initialize a default descriptor, if possible. This behavior is identical to the D3D11 null descriptor behavior, where defaults are filled in. This behavior inherits the resource format and dimension (if not typeless) and RTVs target the first mip and all array slices. Not all resources support null descriptor initialization.

DestDescriptor

Type: D3D12_CPU_DESCRIPTOR_HANDLE

Describes the CPU descriptor handle that represents the start of the heap that holds the render-target view.

Return Value

Returns nothing.

Requirements

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

See Also

ID3D12Device