docs: update RHI API docs

This commit is contained in:
2026-03-20 02:35:45 +08:00
parent ea756c0177
commit 070b444f8f
501 changed files with 13493 additions and 2022 deletions

View File

@@ -0,0 +1,36 @@
# RHICommandQueue::Wait
```cpp
virtual void Wait(RHIFence* fence, uint64_t value) = 0;
```
等待指定栅栏达到或超过 `value` 值。在栅栏值未达到指定值之前,命令队列的所有后续操作都不会开始执行。该方法用于 CPU 到 GPU 同步。
**参数:**
- `fence` - 目标栅栏对象,不能为 `nullptr`
- `value` - 等待的信号值,一个 64 位无符号整数
**返回:**
**线程安全:** ❌ 非线程安全,应在渲染线程中调用
**复杂度:** O(1) - 实际操作取决于底层同步机制
**示例:**
```cpp
#include "RHICommandQueue.h"
#include "RHIFence.h"
void CPUTO GPUSync(RHICommandQueue* cmdQueue, RHIFence* fence) {
cmdQueue->Signal(fence, 1);
cmdQueue->Wait(fence, 1);
}
```
## 相关文档
- [RHICommandQueue 总览](command-queue.md) - 返回类总览
- [Signal](signal.md) - 信号栅栏
- [GetCompletedValue](get-completed-value.md) - 获取完成值
- [RHIFence](../fence/fence.md) - 同步栅栏