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

36 lines
694 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::IsSignaled
```cpp
virtual bool IsSignaled() const = 0;
```
检查围栏是否已发出信号。如果返回 `true`,表示围栏的当前值已达到或超过其初始信号值。
**参数:**
**返回:** 如果围栏已发出信号返回 `true`,否则返回 `false`
**线程安全**:✅
**复杂度**O(1)
**示例**
```cpp
RHIFence* fence = device->CreateFence();
fence->Signal();
// 非阻塞检查围栏状态
while (!fence->IsSignaled()) {
// 执行其他任务或短暂等待
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
// 围栏已发出信号,继续处理
```
## 相关文档
- [RHIFence](fence.md) - 返回类总览