docs: update RHI API docs
This commit is contained in:
36
docs/api/rhi/command-queue/wait.md
Normal file
36
docs/api/rhi/command-queue/wait.md
Normal 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) - 同步栅栏
|
||||
Reference in New Issue
Block a user