diff --git a/Source/Editor/Windows/Profiler/CPU.cs b/Source/Editor/Windows/Profiler/CPU.cs index a93613d13..84ab4ec16 100644 --- a/Source/Editor/Windows/Profiler/CPU.cs +++ b/Source/Editor/Windows/Profiler/CPU.cs @@ -174,14 +174,6 @@ namespace FlaxEditor.Windows.Profiler // Gather CPU events var events = sharedData.GetEventsCPU(); _events.Add(events); - - // Update timeline if using the last frame - if (_mainChart.SelectedSampleIndex == -1) - { - var viewRange = GetEventsViewRange(); - UpdateTimeline(ref viewRange); - UpdateTable(ref viewRange); - } } /// diff --git a/Source/Editor/Windows/Profiler/GPU.cs b/Source/Editor/Windows/Profiler/GPU.cs index cd1c4cfed..a1af36a70 100644 --- a/Source/Editor/Windows/Profiler/GPU.cs +++ b/Source/Editor/Windows/Profiler/GPU.cs @@ -131,13 +131,6 @@ namespace FlaxEditor.Windows.Profiler // Peek draw time _drawTimeCPU.AddSample(sharedData.Stats.DrawCPUTimeMs); _drawTimeGPU.AddSample(sharedData.Stats.DrawGPUTimeMs); - - // Update timeline if using the last frame - if (_drawTimeCPU.SelectedSampleIndex == -1) - { - UpdateTimeline(); - UpdateTable(); - } } /// diff --git a/Source/Editor/Windows/Profiler/ProfilerWindow.cs b/Source/Editor/Windows/Profiler/ProfilerWindow.cs index 27a718077..d70ba7681 100644 --- a/Source/Editor/Windows/Profiler/ProfilerWindow.cs +++ b/Source/Editor/Windows/Profiler/ProfilerWindow.cs @@ -41,7 +41,7 @@ namespace FlaxEditor.Windows.Profiler } /// - /// Gets or sets the index of the selected frame to view (note: some view modes may not use it). + /// Gets or sets the index of the selected frame to view (note: some view modes may not use it). -1 for the last frame. /// public int ViewFrameIndex { @@ -188,7 +188,7 @@ namespace FlaxEditor.Windows.Profiler for (int i = 0; i < _tabs.ChildrenCount; i++) { if (_tabs.Children[i] is ProfilerMode mode) - mode.UpdateView(ViewFrameIndex, _showOnlyLastUpdateEvents); + mode.UpdateView(_frameIndex, _showOnlyLastUpdateEvents); } UpdateButtons(); @@ -208,6 +208,10 @@ namespace FlaxEditor.Windows.Profiler if (_tabs.Children[i] is ProfilerMode mode) mode.Update(ref sharedData); } + { + if (_tabs.SelectedTab is ProfilerMode mode) + mode.UpdateView(_frameIndex, _showOnlyLastUpdateEvents); + } sharedData.End(); _framesCount = Mathf.Min(_framesCount + 1, ProfilerMode.MaxSamples);