diff --git a/server/TracyUserData.cpp b/server/TracyUserData.cpp index 64dcf47d..a6cbceba 100644 --- a/server/TracyUserData.cpp +++ b/server/TracyUserData.cpp @@ -21,7 +21,7 @@ constexpr auto FileAnnotations = "annotations"; constexpr auto FileSourceSubstitutions = "srcsub"; enum : uint32_t { VersionTimeline = 0 }; -enum : uint32_t { VersionOptions = 6 }; +enum : uint32_t { VersionOptions = 7 }; enum : uint32_t { VersionAnnotations = 0 }; enum : uint32_t { VersionSourceSubstitutions = 0 }; @@ -102,6 +102,7 @@ void UserData::LoadState( ViewData& data ) fread( &data.drawPlots, 1, sizeof( data.drawPlots ), f ); fread( &data.onlyContendedLocks, 1, sizeof( data.onlyContendedLocks ), f ); fread( &data.drawEmptyLabels, 1, sizeof( data.drawEmptyLabels ), f ); + fread( &data.drawFrameTargets, 1, sizeof( data.drawFrameTargets ), f ); fread( &data.drawContextSwitches, 1, sizeof( data.drawContextSwitches ), f ); fread( &data.darkenContextSwitches, 1, sizeof( data.darkenContextSwitches ), f ); fread( &data.drawCpuData, 1, sizeof( data.drawCpuData ), f ); @@ -110,6 +111,7 @@ void UserData::LoadState( ViewData& data ) fread( &data.dynamicColors, 1, sizeof( data.dynamicColors ), f ); fread( &data.forceColors, 1, sizeof( data.forceColors ), f ); fread( &data.ghostZones, 1, sizeof( data.ghostZones ), f ); + fread( &data.frameTarget, 1, sizeof( data.frameTarget ), f ); } fclose( f ); } @@ -144,6 +146,7 @@ void UserData::SaveState( const ViewData& data ) fwrite( &data.drawPlots, 1, sizeof( data.drawPlots ), f ); fwrite( &data.onlyContendedLocks, 1, sizeof( data.onlyContendedLocks ), f ); fwrite( &data.drawEmptyLabels, 1, sizeof( data.drawEmptyLabels ), f ); + fwrite( &data.drawFrameTargets, 1, sizeof( data.drawFrameTargets ), f ); fwrite( &data.drawContextSwitches, 1, sizeof( data.drawContextSwitches ), f ); fwrite( &data.darkenContextSwitches, 1, sizeof( data.darkenContextSwitches ), f ); fwrite( &data.drawCpuData, 1, sizeof( data.drawCpuData ), f ); @@ -152,6 +155,7 @@ void UserData::SaveState( const ViewData& data ) fwrite( &data.dynamicColors, 1, sizeof( data.dynamicColors ), f ); fwrite( &data.forceColors, 1, sizeof( data.forceColors ), f ); fwrite( &data.ghostZones, 1, sizeof( data.ghostZones ), f ); + fwrite( &data.frameTarget, 1, sizeof( data.frameTarget ), f ); fclose( f ); } } diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 9de7d947..48a30ffd 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -8335,6 +8335,18 @@ void View::DrawOptions() bool val = m_vd.drawEmptyLabels; ImGui::Checkbox( ICON_FA_EXPAND " Draw empty labels", &val ); m_vd.drawEmptyLabels = val; + val = m_vd.drawFrameTargets; + ImGui::Checkbox( ICON_FA_FLAG_CHECKERED " Draw frame targets", &val ); + m_vd.drawFrameTargets = val; + ImGui::Indent(); + int tmp = m_vd.frameTarget; + ImGui::SetNextItemWidth( 120 ); + if( ImGui::InputInt( "Target FPS", &tmp ) ) + { + if( tmp < 1 ) tmp = 1; + m_vd.frameTarget = tmp; + } + ImGui::Unindent(); if( m_worker.HasContextSwitches() ) { ImGui::Separator(); diff --git a/server/TracyViewData.hpp b/server/TracyViewData.hpp index f11ce54a..760e5f0a 100644 --- a/server/TracyViewData.hpp +++ b/server/TracyViewData.hpp @@ -46,6 +46,7 @@ struct ViewData uint8_t drawPlots = true; uint8_t onlyContendedLocks = true; uint8_t drawEmptyLabels = false; + uint8_t drawFrameTargets = false; uint8_t drawContextSwitches = true; uint8_t darkenContextSwitches = true; uint8_t drawCpuData = true; @@ -54,6 +55,8 @@ struct ViewData uint8_t dynamicColors = 1; uint8_t forceColors = false; uint8_t ghostZones = true; + + uint32_t frameTarget = 60; }; struct Annotation