@@ -959,6 +959,14 @@ namespace Lux {
959959 const float fps = io.Framerate ;
960960 const float frameTimeMs = fps > 0 .0f ? 1000 .0f / fps : 0 .0f ;
961961 const float renderScale = m_SceneRenderer->GetRenderResolutionScale () * 100 .0f ;
962+ const auto & appTimers = Application::Get ().GetPerformanceTimers ();
963+ const float wholeCPUTime = appTimers.MainThreadWorkTime + appTimers.RenderThreadWorkTime ;
964+ float wholeGPUTime = stats.TotalGPUTime ;
965+ if (ImGuiLayer* imguiLayer = Application::Get ().GetImGuiLayer ())
966+ {
967+ if (ImGuiRenderer* imguiRenderer = imguiLayer->GetImGuiRenderer ())
968+ wholeGPUTime += imguiRenderer->GetGPUTime (Renderer::GetCurrentFrameIndex ());
969+ }
962970
963971 const ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoDocking |
964972 ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize |
@@ -969,7 +977,7 @@ namespace Lux {
969977 ImGui::PushStyleVar (ImGuiStyleVar_WindowPadding, ImVec2 (8 .0f , 6 .0f ));
970978 ImGui::Begin (" ##viewport_performance_hud" , nullptr , flags);
971979 ImGui::Text (" FPS %.0f %.2f ms" , fps, frameTimeMs);
972- ImGui::Text (" CPU %.2f ms GPU %.2f ms" , stats. TotalCPUTime , stats. TotalGPUTime );
980+ ImGui::Text (" CPU %.2f ms GPU %.2f ms" , wholeCPUTime, wholeGPUTime );
973981 ImGui::Text (" Draws %u Visible %u" , stats.DrawCalls , stats.VisibleInstances );
974982 ImGui::Text (" GPU Visible %u" , stats.GPUVisibleInstances );
975983 if (memory.BudgetBytes > 0 )
0 commit comments