From 97d9368741fb55cda86213f932ff8de80c558242 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 31 Oct 2026 14:16:55 +0100 Subject: [PATCH] Add a GPU statistics achievement. --- profiler/CMakeLists.txt | 1 + profiler/src/achievements/GpuStats.md | 5 +++++ profiler/src/profiler/TracyAchievementData.cpp | 11 ++++++++++- profiler/src/profiler/TracyView_Statistics.cpp | 5 ++++- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 profiler/src/achievements/GpuStats.md diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 9940300d..fbf2efa3 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -215,6 +215,7 @@ Embed(PROFILER_FILES TextFrameImages src/achievements/FrameImages.md TEXT) Embed(PROFILER_FILES TextGhostZones src/achievements/GhostZones.md TEXT) Embed(PROFILER_FILES TextGlobalSettings src/achievements/GlobalSettings.md TEXT) Embed(PROFILER_FILES TextGpu src/achievements/Gpu.md TEXT) +Embed(PROFILER_FILES TextGpuStats src/achievements/GpuStats.md TEXT) Embed(PROFILER_FILES TextInspectZone src/achievements/InspectZone.md TEXT) Embed(PROFILER_FILES TextInstrumentationIntro src/achievements/InstrumentationIntro.md TEXT) Embed(PROFILER_FILES TextInstrumentationStatistics src/achievements/InstrumentationStatistics.md TEXT) diff --git a/profiler/src/achievements/GpuStats.md b/profiler/src/achievements/GpuStats.md new file mode 100644 index 00000000..d0ff5ce6 --- /dev/null +++ b/profiler/src/achievements/GpuStats.md @@ -0,0 +1,5 @@ +# GPU statistics + +The timeline tells you when each GPU zone ran. To see their combined cost, the [Statistics window](#statistics) has a * GPU* mode, available whenever the trace contains [GPU zones](#gpuprofiling). It aggregates device-side execution time per zone across the whole capture, with no self/total split on the GPU, and therefore no `Timing` selector. + +Switch to it and see which zones kept your GPU busy. Try it out! diff --git a/profiler/src/profiler/TracyAchievementData.cpp b/profiler/src/profiler/TracyAchievementData.cpp index 85428c20..181271a0 100644 --- a/profiler/src/profiler/TracyAchievementData.cpp +++ b/profiler/src/profiler/TracyAchievementData.cpp @@ -12,6 +12,7 @@ #include "data/TextGhostZones.hpp" #include "data/TextGlobalSettings.hpp" #include "data/TextGpu.hpp" +#include "data/TextGpuStats.hpp" #include "data/TextInspectZone.hpp" #include "data/TextInstrumentFrames.hpp" #include "data/TextInstrumentationIntro.hpp" @@ -81,10 +82,18 @@ AchievementItem ai_trackMemory = { AchievementItem* ac_memoryItems[] = { &ai_trackMemory, nullptr }; AchievementCategory ac_memory = { "memory", "Memory", ac_memoryItems }; +AchievementItem ai_gpuStats = { + .id = "gpuStats", + .name = "GPU statistics", + .text = Unpack( TextGpuStats ) +}; + +AchievementItem* ac_profileGpuItems[] = { &ai_gpuStats, nullptr }; AchievementItem ai_profileGpu = { .id = "profileGpu", .name = "Profile the GPU", - .text = Unpack( TextGpu ) + .text = Unpack( TextGpu ), + .items = ac_profileGpuItems }; AchievementItem* ac_gpuItems[] = { &ai_profileGpu, nullptr }; diff --git a/profiler/src/profiler/TracyView_Statistics.cpp b/profiler/src/profiler/TracyView_Statistics.cpp index 7bc3e0d0..362328a2 100644 --- a/profiler/src/profiler/TracyView_Statistics.cpp +++ b/profiler/src/profiler/TracyView_Statistics.cpp @@ -80,7 +80,10 @@ void View::DrawStatistics() ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - ImGui::RadioButton( ICON_FA_DISPLAY " GPU", &m_statMode, 2 ); + if( ImGui::RadioButton( ICON_FA_DISPLAY " GPU", &m_statMode, 2 ) ) + { + if( s_config.achievements ) Achieve( "gpuStats" ); + } } ImGui::SameLine(); ImGui::Spacing();