36
36
#include " AdvancedMath.hpp"
37
37
#include " PBR_Renderer.hpp"
38
38
#include " FileSystem.hpp"
39
+ #include " Timer.hpp"
40
+
39
41
#include " Tasks/HnReadRprimIdTask.hpp"
40
42
#include " Tasks/HnRenderAxesTask.hpp"
41
43
#include " HnTokens.hpp"
@@ -330,6 +332,8 @@ void USDViewer::Render()
330
332
if (!m_Stage)
331
333
return ;
332
334
335
+ Timer Stowatch;
336
+
333
337
m_Stage.Camera ->SetViewMatrix (m_CameraView);
334
338
m_Stage.Camera ->SetProjectionMatrix (m_CameraProj);
335
339
@@ -358,6 +362,8 @@ void USDViewer::Render()
358
362
m_Stats.NumTriangles = CtxStats.GetTotalTriangleCount ();
359
363
m_Stats.NumLines = CtxStats.GetTotalLineCount ();
360
364
m_Stats.NumPoints = CtxStats.GetTotalPointCount ();
365
+
366
+ m_Stats.TaskRunTime = static_cast <float >(Stowatch.GetElapsedTime ()) * 0 .05f + m_Stats.TaskRunTime * 0 .95f ;
361
367
}
362
368
363
369
void USDViewer::PopulateSceneTree (const pxr::UsdPrim& Prim)
@@ -687,7 +693,8 @@ void USDViewer::UpdateUI()
687
693
if (ImGui::BeginTabItem (" Stats" ))
688
694
{
689
695
const auto MemoryStats = m_Stage.RenderDelegate ->GetMemoryStats ();
690
- ImGui::TextDisabled (" Num draws\n "
696
+ ImGui::TextDisabled (" Task time\n "
697
+ " Num draws\n "
691
698
" Tris\n "
692
699
" Lines\n "
693
700
" Points\n "
@@ -708,7 +715,8 @@ void USDViewer::UpdateUI()
708
715
const std::string IndPoolCommittedSizeStr = GetMemorySizeString (MemoryStats.IndexPool .CommittedSize ).c_str ();
709
716
const std::string IndPoolUsedSizeStr = GetMemorySizeString (MemoryStats.IndexPool .UsedSize ).c_str ();
710
717
const std::string AtlasCommittedSizeStr = GetMemorySizeString (MemoryStats.Atlas .CommittedSize ).c_str ();
711
- ImGui::TextDisabled (" %d\n "
718
+ ImGui::TextDisabled (" %.1f ms\n "
719
+ " %d\n "
712
720
" %d\n "
713
721
" %d\n "
714
722
" %d\n "
@@ -722,6 +730,7 @@ void USDViewer::UpdateUI()
722
730
" %s / %s (%d allocs, %dK verts)\n "
723
731
" %s / %s (%d allocs)\n "
724
732
" %s (%.1lf%%, %d allocs)" ,
733
+ m_Stats.TaskRunTime * 1000 .f ,
725
734
m_Stats.NumDrawCommands ,
726
735
m_Stats.NumTriangles ,
727
736
m_Stats.NumLines ,
0 commit comments