diff --git a/src/i_video_common.cpp b/src/i_video_common.cpp index 54ee9c876..b61145c46 100644 --- a/src/i_video_common.cpp +++ b/src/i_video_common.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "cxxutil.hpp" #include "f_finale.h" @@ -292,6 +293,7 @@ void I_FinishUpdate(void) { if (rendermode == render_none) { + FrameMark; return; } @@ -299,6 +301,7 @@ void I_FinishUpdate(void) if (rendermode == render_opengl) { finish_legacy_ogl_update(); + FrameMark; return; } #endif @@ -310,6 +313,7 @@ void I_FinishUpdate(void) if (rhi == nullptr) { // ??? + FrameMark; return; } @@ -338,6 +342,8 @@ void I_FinishUpdate(void) rhi->present(); rhi->finish(); + FrameMark; + // Immediately prepare to begin drawing the next frame I_StartDisplayUpdate(); } diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 664984ab3..e313d8c20 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -27,6 +27,8 @@ #include #include +#include + #if defined (__GNUC__) || defined (__unix__) #include #endif @@ -278,6 +280,8 @@ int main(int argc, char **argv) myargc = argc; myargv = argv; /// \todo pull out path to exe from this string + tracy::SetThreadName("Main"); + #ifdef HAVE_TTF #ifdef _WIN32 I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE); diff --git a/src/sdl/new_sound.cpp b/src/sdl/new_sound.cpp index 46cf45094..f86f41462 100644 --- a/src/sdl/new_sound.cpp +++ b/src/sdl/new_sound.cpp @@ -12,6 +12,7 @@ #include #include +#include #include "../audio/chunk_load.hpp" #include "../audio/gain.hpp" @@ -121,8 +122,12 @@ public: ~SdlAudioLockHandle() { SDL_UnlockAudio(); } }; +static const char* kAudio = "Audio"; + void audio_callback(void* userdata, Uint8* buffer, int len) { + tracy::SetThreadName("SDL Audio Thread"); + FrameMarkStart(kAudio); // The SDL Audio lock is implied to be held during callback. try @@ -156,6 +161,8 @@ void audio_callback(void* userdata, Uint8* buffer, int len) { } + FrameMarkEnd(kAudio); + return; }