feat: RenderGraph GPU timestamp profiling
- RG::SetQueryPool 可选注入;Execute 期每 pass 前后各写一枚 writeTimestamp2(BOTTOM_OF_PIPE),索引按帧槽位分区 + 执行序排布 - 每帧录制开头 reset 本槽位查询区间(上一轮结果已在 fence 等待后读取) - Renderer 在 WaitFence 后读 64bit 结果换算毫秒(timestampPeriod 缓存), 经 GetPassNames/GetPassGpuMs 透出给 ImGui 面板显示 - 每槽位首帧跳过读取(查询尚未 primed,避免 VUID-09401)
This commit is contained in:
@@ -154,6 +154,15 @@ protected:
|
||||
renderer.SetBloomStrength(strength);
|
||||
}
|
||||
|
||||
// Pass 级 GPU 耗时(RG timestamp)
|
||||
ImGui::Separator();
|
||||
ImGui::Text("GPU Timings");
|
||||
const auto& names = renderer.GetPassNames();
|
||||
const auto& times = renderer.GetPassGpuMs();
|
||||
for (size_t i = 0; i < names.size() && i < times.size(); ++i) {
|
||||
ImGui::Text(" %-12s %.3f ms", names[i].c_str(), times[i]);
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
ImGui::Text("fps: %.1f frame: %llu",
|
||||
1.0f / GetDeltaTime(),
|
||||
|
||||
Reference in New Issue
Block a user