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

35 lines
636 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::GetCompletedValue
```cpp
virtual uint64_t GetCompletedValue() const = 0;
```
获取围栏已完成的最大值。该值表示 GPU 已完成的所有信号操作中的最高值。
**参数:**
**返回:** 已完成的围栏值(`uint64_t`
**线程安全**:✅
**复杂度**O(1)
**示例**
```cpp
RHIFence* fence = device->CreateFence();
fence->Signal(100ULL);
uint64_t completed = fence->GetCompletedValue();
// completed >= 100 表示 GPU 已完成该信号
if (completed >= 100) {
// GPU 已完成 100 之前的所有工作
}
```
## 相关文档
- [RHIFence](fence.md) - 返回类总览