Files
XCEngine/docs/api/rhi/fence/signal.md
2026-03-20 02:35:45 +08:00

33 lines
627 B
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.
# RHIFence::Signal
```cpp
virtual void Signal() = 0;
```
将围栏值设置为当前设备的信号值,并通知 GPU 该围栏已被触发。此方法使围栏处于有信号状态CPU 和 GPU 可以据此进行同步操作。
**参数:**
**返回:**
**线程安全**:❌
**复杂度**O(1)
**示例**
```cpp
RHIFence* fence = device->CreateFence();
// 提交 GPU 命令后发送信号
fence->Signal();
// 或者在 CPU 端等待
fence->Wait(fence->GetCompletedValue());
```
## 相关文档
- [RHIFence](fence.md) - 返回类总览
- [Signal(value)](signal-value.md) - 带值版本的 Signal