> ## 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.

# CreateCommandAllocator

> 명령 할당자 객체를 만듭니다.

명령 할당자 객체를 만듭니다.

## 구문

```cpp theme={null}
HRESULT CreateCommandAllocator(
    D3D12_COMMAND_LIST_TYPE type,
    const IID & riid,
    void  ppCommandAllocator
)
```

### 매개 변수

*type \[in]*\
형식: D3D12\_COMMAND\_LIST\_TYPE

만들 명령 할당자의 유형을 지정하는 [D3D12\_COMMAND\_LIST\_TYPE](/reference/graphics/d3d12_x/enums/d3d12_command_list_type) 형식의 값입니다.
명령 할당자의 유형은 직접 명령 목록 또는 번들을 기록하는 유형일 수 있습니다.

*riid*\
형식: const IID &

명령 할당자 인터페이스([ID3D12CommandAllocator](/reference/graphics/d3d12_x/interfaces/ID3D12CommandAllocator/id3d12commandallocator))의 전역 고유 식별자(**GUID**)입니다.
명령 할당자에 대한 인터페이스의 **REFIID** 또는 **GUID**는 \_\_uuidof() 매크로를 사용하여 얻을 수 있습니다.
예를 들어, \_\_uuidof(ID3D12CommandAllocator)는 명령 할당자에 대한 인터페이스의 **GUID**를 가져옵니다.

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

명령 할당자에 대한 [ID3D12CommandAllocator](/reference/graphics/d3d12_x/interfaces/ID3D12CommandAllocator/id3d12commandallocator) 인터페이스에 대한 포인터를 받는 메모리 블록에 대한 포인터입니다.

### 반환 값

형식: HRESULT

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

## 설명

디바이스는 명령 할당자에서 명령 목록을 만듭니다.

#### 예제

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

```cpp theme={null}
ThrowIfFailed(pDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&m_commandAllocator)));
ThrowIfFailed(pDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, IID_PPV_ARGS(&m_bundleAllocator)));

```

[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

- [CreateCommandList](/ko/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommandlist_public.md)
- [ID3D12CommandAllocator::Reset](/ko/reference/graphics/d3d12/interfaces/id3d12commandallocator/methods/id3d12commandallocator_reset_public.md)
- [XALLOC_ALLOCATOR_IDS](/ko/reference/system/xmem/enums/xalloc_allocator_ids.md)
- [CreateCommandQueue](/ko/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommandqueue_public.md)
- [CreateCommandSignature](/ko/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createcommandsignature_public.md)
