Files
XCEngine/docs/api/rhi/d3d12/command-queue/command-queue.md
2026-03-20 02:35:45 +08:00

50 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# D3D12CommandQueue
**命名空间**: `XCEngine::RHI`
**类型**: `class`
**继承**: `RHICommandQueue`
**描述**: DirectX 12 命令队列的 D3D12 实现,继承自 `RHICommandQueue`
## 公共方法
| 方法 | 描述 | 类型 |
|------|------|------|
| [`Initialize`](initialize.md) | 初始化命令队列 | D3D12 特有 |
| [`Shutdown`](shutdown.md) | 关闭命令队列 | Override |
| [`ExecuteCommandLists`](execute-command-lists.md) | 执行命令列表 | Override |
| [`Signal`](signal.md) | 信号栅栏RHIFence 重载) | Override |
| [`Signal(ID3D12Fence*)`](signal-native.md) | 信号栅栏Native D3D12Fence | D3D12 特有 |
| [`Wait`](wait.md) | 等待栅栏达到指定值 | Override |
| [`Wait(ID3D12Fence*)`](wait-native.md) | 等待栅栏Native D3D12Fence | D3D12 特有 |
| [`GetCompletedValue`](get-completed-value.md) | 获取完成值 | Override |
| [`WaitForIdle`](wait-for-idle.md) | 等待空闲 | Override |
| [`GetType`](get-type.md) | 获取队列类型 | Override |
| [`GetTimestampFrequency`](get-timestamp-frequency.md) | 获取时间戳频率 | Override |
| [`GetCommandQueue`](get-command-queue.md) | 获取 D3D12 命令队列 | D3D12 特有 |
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 | Override |
## 使用示例
```cpp
ID3D12Device* device; // 初始化好的 D3D12 设备
D3D12CommandQueue commandQueue;
if (commandQueue.Initialize(device, CommandQueueType::Direct)) {
// 使用命令队列
commandQueue.ExecuteCommandLists(count, lists);
// 等待完成
commandQueue.WaitForIdle();
}
```
## 相关文档
- [D3D12 后端总览](../d3d12.md)
- [RHICommandQueue](../../command-queue/command-queue.md) - 抽象命令队列接口
- [D3D12CommandList](../command-list/command-list.md)
- [D3D12Fence](../fence/fence.md)