Add a GPU statistics achievement.

This commit is contained in:
Bartosz Taudul
2026-10-31 18:13:32 +01:00
parent c6e8813c3a
commit 97d9368741
4 changed files with 20 additions and 2 deletions
+1
View File
@@ -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)
+5
View File
@@ -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!
+10 -1
View File
@@ -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 };
@@ -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();