Add callstack samples drawing option.

This commit is contained in:
Bartosz Taudul 2020-02-22 17:35:29 +01:00
parent 597911e5a8
commit b425374cb7
3 changed files with 12 additions and 1 deletions

View File

@ -20,7 +20,7 @@ constexpr auto FileOptions = "options";
constexpr auto FileAnnotations = "annotations";
enum : uint32_t { VersionTimeline = 0 };
enum : uint32_t { VersionOptions = 3 };
enum : uint32_t { VersionOptions = 4 };
enum : uint32_t { VersionAnnotations = 0 };
UserData::UserData()
@ -104,6 +104,7 @@ void UserData::LoadState( ViewData& data )
fread( &data.darkenContextSwitches, 1, sizeof( data.darkenContextSwitches ), f );
fread( &data.drawCpuData, 1, sizeof( data.drawCpuData ), f );
fread( &data.drawCpuUsageGraph, 1, sizeof( data.drawCpuUsageGraph ), f );
fread( &data.drawSamples, 1, sizeof( data.drawSamples ), f );
fread( &data.dynamicColors, 1, sizeof( data.dynamicColors ), f );
}
fclose( f );
@ -143,6 +144,7 @@ void UserData::SaveState( const ViewData& data )
fwrite( &data.darkenContextSwitches, 1, sizeof( data.darkenContextSwitches ), f );
fwrite( &data.drawCpuData, 1, sizeof( data.drawCpuData ), f );
fwrite( &data.drawCpuUsageGraph, 1, sizeof( data.drawCpuUsageGraph ), f );
fwrite( &data.drawSamples, 1, sizeof( data.drawSamples ), f );
fwrite( &data.dynamicColors, 1, sizeof( data.dynamicColors ), f );
fclose( f );
}

View File

@ -7265,6 +7265,14 @@ void View::DrawOptions()
#endif
m_vd.drawCpuUsageGraph = val;
ImGui::Unindent();
val = m_vd.drawSamples;
#ifdef TRACY_EXTENDED_FONT
ImGui::Checkbox( ICON_FA_EYE_DROPPER " Draw stack samples", &val );
#else
ImGui::Checkbox( "Draw stack samples", &val );
#endif
m_vd.drawSamples = val;
}
const auto& gpuData = m_worker.GetGpuData();

View File

@ -25,6 +25,7 @@ struct ViewData
uint8_t darkenContextSwitches = true;
uint8_t drawCpuData = true;
uint8_t drawCpuUsageGraph = true;
uint8_t drawSamples = true;
uint8_t dynamicColors = 1;
};