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

35 lines
700 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(uint64_t value) = 0;
```
将围栏设置为指定的值并通知 GPU。该方法允许设置自定义的围栏值用于更精细的同步控制。
**参数:**
- `value` - 要设置的围栏值,一个 64 位无符号整数
**返回:**
**线程安全**:❌
**复杂度**O(1)
**示例**
```cpp
RHIFence* fence = device->CreateFence();
// 设置围栏值为特定标记
const uint64_t kFrameFenceValue = 1000ULL;
fence->Signal(kFrameFenceValue);
// 等待直到围栏达到指定值
fence->Wait(kFrameFenceValue);
```
## 相关文档
- [RHIFence](fence.md) - 返回类总览
- [Signal](signal.md) - 无参数版本的 Signal