Files
XCEngine/docs/api/rhi/d3d12/command-allocator/get-command-allocator.md

26 lines
546 B
Markdown
Raw Normal View History

# D3D12CommandAllocator::GetCommandAllocator
```cpp
ID3D12CommandAllocator* GetCommandAllocator() const { return m_commandAllocator.Get(); }
```
获取底层的 D3D12 命令分配器接口。
2026-03-20 02:35:45 +08:00
## 示例
```cpp
D3D12CommandAllocator allocator;
if (allocator.Initialize(device)) {
ID3D12CommandAllocator* native = allocator.GetCommandAllocator();
// 使用原生 D3D12 接口
}
```
**返回:** `ID3D12CommandAllocator*`
**复杂度:** O(1)
## 相关文档
- [D3D12CommandAllocator 总览](command-allocator.md) - 返回类总览