mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Add Tracy frame time instrumentation
This commit is contained in:
parent
e9d789abc9
commit
42e5646c15
3 changed files with 17 additions and 0 deletions
|
|
@ -14,6 +14,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
#include <tracy/tracy/Tracy.hpp>
|
||||||
|
|
||||||
#include "cxxutil.hpp"
|
#include "cxxutil.hpp"
|
||||||
#include "f_finale.h"
|
#include "f_finale.h"
|
||||||
|
|
@ -292,6 +293,7 @@ void I_FinishUpdate(void)
|
||||||
{
|
{
|
||||||
if (rendermode == render_none)
|
if (rendermode == render_none)
|
||||||
{
|
{
|
||||||
|
FrameMark;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,6 +301,7 @@ void I_FinishUpdate(void)
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
finish_legacy_ogl_update();
|
finish_legacy_ogl_update();
|
||||||
|
FrameMark;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -310,6 +313,7 @@ void I_FinishUpdate(void)
|
||||||
if (rhi == nullptr)
|
if (rhi == nullptr)
|
||||||
{
|
{
|
||||||
// ???
|
// ???
|
||||||
|
FrameMark;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,6 +342,8 @@ void I_FinishUpdate(void)
|
||||||
rhi->present();
|
rhi->present();
|
||||||
rhi->finish();
|
rhi->finish();
|
||||||
|
|
||||||
|
FrameMark;
|
||||||
|
|
||||||
// Immediately prepare to begin drawing the next frame
|
// Immediately prepare to begin drawing the next frame
|
||||||
I_StartDisplayUpdate();
|
I_StartDisplayUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <tracy/tracy/Tracy.hpp>
|
||||||
|
|
||||||
#if defined (__GNUC__) || defined (__unix__)
|
#if defined (__GNUC__) || defined (__unix__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -278,6 +280,8 @@ int main(int argc, char **argv)
|
||||||
myargc = argc;
|
myargc = argc;
|
||||||
myargv = argv; /// \todo pull out path to exe from this string
|
myargv = argv; /// \todo pull out path to exe from this string
|
||||||
|
|
||||||
|
tracy::SetThreadName("Main");
|
||||||
|
|
||||||
#ifdef HAVE_TTF
|
#ifdef HAVE_TTF
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE);
|
I_StartupTTF(FONTPOINTSIZE, SDL_INIT_VIDEO|SDL_INIT_AUDIO, SDL_SWSURFACE);
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
#include <tracy/tracy/Tracy.hpp>
|
||||||
|
|
||||||
#include "../audio/chunk_load.hpp"
|
#include "../audio/chunk_load.hpp"
|
||||||
#include "../audio/gain.hpp"
|
#include "../audio/gain.hpp"
|
||||||
|
|
@ -121,8 +122,12 @@ public:
|
||||||
~SdlAudioLockHandle() { SDL_UnlockAudio(); }
|
~SdlAudioLockHandle() { SDL_UnlockAudio(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char* kAudio = "Audio";
|
||||||
|
|
||||||
void audio_callback(void* userdata, Uint8* buffer, int len)
|
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.
|
// The SDL Audio lock is implied to be held during callback.
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
@ -156,6 +161,8 @@ void audio_callback(void* userdata, Uint8* buffer, int len)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FrameMarkEnd(kAudio);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue