842 B
842 B
D3D12CommandAllocator::Initialize
bool Initialize(ID3D12Device* device, CommandQueueType type = CommandQueueType::Direct);
初始化 D3D12 命令分配器,创建指定类型的命令分配器。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
device |
ID3D12Device* |
D3D12 设备指针 |
type |
CommandQueueType |
命令队列类型,默认值为 Direct |
返回值
bool - 初始化是否成功
示例
D3D12CommandAllocator allocator;
if (allocator.Initialize(device, CommandQueueType::Direct)) {
// 分配器初始化成功
}
复杂度
O(1)
相关文档
- D3D12CommandAllocator 总览 - 返回类总览
- D3D12CommandAllocator::Reset - 重置分配器
- D3D12CommandAllocator::Shutdown - 关闭分配器