Files
XCEngine/docs/api/rhi/command-queue/get-completed-value.md
2026-03-20 02:35:45 +08:00

35 lines
861 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.
# RHICommandQueue::GetCompletedValue
```cpp
virtual uint64_t GetCompletedValue() = 0;
```
查询栅栏的当前完成值。返回值表示栅栏已被 GPU 完成的最新信号值。如果返回的值小于等待的值,则表示 GPU 尚未完成到该点的所有操作。
**参数:**
**返回:** 栅栏已完成的最大信号值uint64_t
**线程安全:** ✅ 线程安全,可以从任意线程调用
**复杂度:** O(1)
**示例:**
```cpp
#include "RHICommandQueue.h"
#include "RHIFence.h"
void CheckFenceStatus(RHICommandQueue* cmdQueue, RHIFence* fence) {
uint64_t completed = cmdQueue->GetCompletedValue();
if (completed >= fence->GetCurrentValue()) {
}
}
```
## 相关文档
- [RHICommandQueue 总览](command-queue.md) - 返回类总览
- [Signal](signal.md) - 信号栅栏
- [Wait](wait.md) - 等待栅栏