32 lines
759 B
Markdown
32 lines
759 B
Markdown
# D3D12CommandQueue::Initialize
|
|
|
|
```cpp
|
|
bool Initialize(ID3D12Device* device, CommandQueueType type = CommandQueueType::Direct);
|
|
```
|
|
|
|
初始化 D3D12 命令队列,创建底层 `ID3D12CommandQueue` 对象。
|
|
|
|
**参数:**
|
|
- `device` - D3D12 设备指针
|
|
- `type` - 命令队列类型,默认为 `Direct`
|
|
|
|
**返回:** 初始化成功返回 `true`,失败返回 `false`
|
|
|
|
**复杂度:** O(1)
|
|
|
|
## 示例
|
|
|
|
```cpp
|
|
ID3D12Device* device; // 已初始化的 D3D12 设备
|
|
D3D12CommandQueue commandQueue;
|
|
|
|
if (commandQueue.Initialize(device, CommandQueueType::Direct)) {
|
|
// 命令队列初始化成功
|
|
}
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [D3D12CommandQueue 总览](command-queue.md) - 返回类总览
|
|
- [Shutdown](../../command-queue/shutdown.md) - 关闭命令队列
|