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

26 lines
553 B
Markdown
Raw Normal View History

2026-03-20 02:35:45 +08:00
# D3D12CommandAllocator::Reset
```cpp
void Reset();
```
重置命令分配器,将分配器重置为初始状态,使其可以重新使用。此方法必须在 GPU 完成所有使用该分配器的命令后才能调用。
## 示例
```cpp
D3D12CommandAllocator allocator;
if (allocator.Initialize(device)) {
allocator.Reset(); // 重置以重新使用
}
```
## 复杂度
O(1)
## 相关文档
- [D3D12CommandAllocator 总览](command-allocator.md) - 返回类总览
- [D3D12CommandAllocator::Initialize](initialize.md) - 初始化分配器