1. Command List
Command List는 GPU가 작업할 명령어를 추가하는 인터페이스이다.
대표적으로 ID3D12CommandList 인터페이스와 이것을 상속받아 그래픽 명령을 내리는 ID3D12GraphicsCommandList 인터페이스가 있다.
ID3D12Device의 CreateCommandList로 생성할 수 있다.
- nodeMask : 명령어 리스트를 생성할 어댑터, GPU가 하나일 때는 0, 여러 개가 있을 때에는 대상 GPU의 비트로 설정
- type : Command List의 형식
- pCommandAllocator : Command List에 연결시킬 Command Allocator, 동일한 D3D12_Command_List_Type로 설정되어 있어야 한다.
- riid, ppCommandList : IID_PPV_ARGS매크로로 대체 가능, ppCommandList에 생성된 CommandList가 할당됨
비동기 렌더링을 위한 디자인이다.
여러 Command List를 독립적으로 사용하는 것이 성능에 좋다.
2. Command Allocator
Command Allocator는 Command List가 추가한 GPU가 작업할 명령들이 담겨있는 공간이다.
Command Queue는 이곳에 있는 명렁들을 참조한다.
ID3D12Device의 CreateCommandAllocator로 생성할 수 있다.
- type : Command Allocator의 형식, 연결된 Command List와 같은 형식이여야 한다.
Microsoft Learn - riid, ppCommandAllocator : IID_PPV_ARGS매크로로 대체 가능, ppCommandAllocato에 생성된 CommandAllocator가 할당됨
3. Command Queue
GPU가 실행할 명령들이 대기하는 대기열
ExecuteCommandLists함수로 Command Allocator에 있는 명령들을 참조한다.
ID3D12Device의 CreateCommandQueue로 생성할 수 있다.
- pDesc : CommandQueue의 형식을 지정하는 구조체이다. CommandList의 형식, 큐의 우선순위, 큐의 타입, 큐를 생성할 GPU를 설정할 수 있다.
- riid, ppCommandAllocator : IID_PPV_ARGS매크로로 대체 가능, ppCommandQueue에 생성된 CommandQueue가 할당됨
'DirectX12' 카테고리의 다른 글
[DirectX12] 렌더링 파이프라인 (1) | 2024.01.28 |
---|---|
[DirectX12] 안티 앨리어싱 (1) | 2024.01.27 |
[DirectX12] 장치 생성 (1) | 2024.01.26 |
[DirectX12] Fence (0) | 2024.01.25 |
[DirectX12] Swap Chain (0) | 2024.01.24 |