> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateDescriptorHeap

> 디스크립터 힙 객체를 만듭니다.

디스크립터 힙 객체를 만듭니다.

## 구문

```cpp theme={null}
HRESULT CreateDescriptorHeap(
    const D3D12_DESCRIPTOR_HEAP_DESC  pDescriptorHeapDesc,
    const IID & riid,
    void  ppvHeap
)
```

### 매개 변수

*pDescriptorHeapDesc \[in]*\
형식: const D3D12\_DESCRIPTOR\_HEAP\_DESC \*

힙을 설명하는 [D3D12\_DESCRIPTOR\_HEAP\_DESC](/reference/graphics/d3d12/structs/d3d12_descriptor_heap_desc_public) 구조체에 대한 포인터입니다.

*riid*\
형식: const IID &

디스크립터 힙 인터페이스의 전역 고유 식별자(**GUID**)입니다. 설명을 참조하세요.
입력 매개 변수입니다.

*ppvHeap \[out]*\
형식: void \*\*

디스크립터 힙에 대한 포인터를 받는 메모리 블록에 대한 포인터입니다.
<i>ppvHeap</i>은 기능 테스트를 활성화하려면 NULL일 수 있습니다.
<i>ppvHeap</i>이 NULL인 경우 객체가 생성되지 않으며 <i>pDescriptorHeapDesc</i>가 유효하면 S\_FALSE가 반환됩니다.

### 반환 값

형식: HRESULT

디스크립터 힙 객체를 만들 메모리가 부족한 경우 이 메서드는 **E\_OUTOFMEMORY**를 반환합니다.
다른 가능한 반환 값은 [Direct3D 12 반환 코드](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)를 참조하세요.

## 설명

디스크립터 힙에 대한 인터페이스의 **REFIID** 또는 **GUID**는 \_\_uuidof() 매크로를 사용하여 얻을 수 있습니다. 예를 들어, \_\_uuidof([ID3D12DescriptorHeap](/reference/graphics/d3d12/interfaces/id3d12descriptorheap/id3d12descriptorheap_public))는 디스크립터 힙에 대한 인터페이스의 **GUID**를 가져옵니다.

#### 예제

[D3D12HelloWorld](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/working-samples) 샘플은 다음과 같이 **ID3D12Device::CreateDescriptorHeap**을 사용합니다:

렌더 타깃 뷰(RTV) 디스크립터 힙을 설명하고 만듭니다.

```cpp theme={null}
// Create descriptor heaps.
{
// Describe and create a render target view (RTV) descriptor heap.
D3D12_DESCRIPTOR_HEAP_DESC rtvHeapDesc = {};
rtvHeapDesc.NumDescriptors = FrameCount;
rtvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
rtvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;
ThrowIfFailed(m_device->CreateDescriptorHeap(&rtvHeapDesc, IID_PPV_ARGS(&m_rtvHeap)));

m_rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
}

// Create frame resources.
{
CD3DX12_CPU_DESCRIPTOR_HANDLE rtvHandle(m_rtvHeap->GetCPUDescriptorHandleForHeapStart());

// Create a RTV for each frame.
for (UINT n = 0; n < FrameCount; n++)
{
ThrowIfFailed(m_swapChain->GetBuffer(n, IID_PPV_ARGS(&m_renderTargets[n])));
m_device->CreateRenderTargetView(m_renderTargets[n].Get(), nullptr, rtvHandle);
rtvHandle.Offset(1, m_rtvDescriptorSize);
}

```

[D3D12 참조의 예제 코드](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/notes-on-example-code)를 참조하세요.

<div class="code" />

## 요구 사항

**헤더:** d3d12\_xs.h 또는 d3d12\_x.h\
**라이브러리:** d3d12\_xs.lib 또는 d3d12\_x.lib\
**지원 플랫폼**: XBOX Series 콘솔 및 XBOX One 제품군

## 함께 보기

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [D3D12_DESCRIPTOR_HEAP_DESC](/ko/reference/graphics/d3d12/structs/d3d12_descriptor_heap_desc_public.md)
- [SetDescriptorHeaps](/ko/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setdescriptorheaps_public.md)
- [D3D12_CPU_DESCRIPTOR_HANDLE](/ko/reference/graphics/d3d12/structs/d3d12_cpu_descriptor_handle_public.md)
- [D3D12_DESCRIPTOR_HEAP_TYPE](/ko/reference/graphics/d3d12/enums/d3d12_descriptor_heap_type_public.md)
- [ID3D12DescriptorHeap](/ko/reference/graphics/d3d12/interfaces/id3d12descriptorheap/id3d12descriptorheap_public.md)
