Some stats

This commit is contained in:
Shinovon 2026-05-03 01:29:57 +05:00
parent 1209902fe9
commit 7e7188abbd
6 changed files with 54 additions and 0 deletions

View file

@ -1750,7 +1750,9 @@ Idle(void *arg)
if (gbShowTimebars)
tbDisplay();
tbStartTimer(0, "EndOfFrame");
DoRWStuffEndOfFrame();
tbEndTimer("EndOfFrame");
POP_MEMID(); // MEMID_RENDER

View file

@ -29,10 +29,23 @@ float MaxFrameTime;
uint32 curMS;
uint32 msCollected[MAX_MS_COLLECTED];
uint frames;
#ifdef FRAMETIME
float FrameInitTime;
#endif
extern "C" int vboUploads;
extern "C" int draw;
extern "C" int render;
extern "C" int matfx;
extern "C" int skin;
int vboUploads;
int draw;
int render;
int matfx;
int skin;
float endOfFrameTime;
void tbInit()
{
TimerBar.count = 0;
@ -67,6 +80,9 @@ void tbEndTimer(Const char* name)
}
assert(n != 1500);
TimerBar.Timers[n].endTime = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerFrame();
if (strcmp(name, "EndOfFrame")) {
endOfFrameTime = TimerBar.Timers[n].endTime - TimerBar.Timers[n].startTime;
}
}
float Diag_GetFPS()
@ -74,6 +90,8 @@ float Diag_GetFPS()
return 39000.0f / (msCollected[(curMS - 1) % MAX_MS_COLLECTED] - msCollected[curMS % MAX_MS_COLLECTED]);
}
extern "C" void RDebug_Printf(const char*, ...);
void tbDisplay()
{
char temp[200];
@ -94,6 +112,26 @@ void tbDisplay()
CFont::SetPropOn();
CFont::SetFontStyle(FONT_BANK);
sprintf(temp, "FPS: %.2f", Diag_GetFPS());
if (frames >= 15) {
RDebug_Printf("FPS: %.2f", Diag_GetFPS());
RDebug_Printf("vbo: %d, draw: %d, render: %d, matfx: %d, skin: %d ", vboUploads, draw, render, matfx, skin);
for (uint32 i = 0; i < TimerBar.count; i++) {
MaxTimes[i] = Max(MaxTimes[i], TimerBar.Timers[i].endTime - TimerBar.Timers[i].startTime);
RDebug_Printf("%s: %.2f", &TimerBar.Timers[i].name[0], MaxTimes[i]);
}
MaxFrameTime = Max(MaxFrameTime, FrameEndTime - FrameInitTime);
RDebug_Printf("EndOfFrame: %.2f", endOfFrameTime);
RDebug_Printf("Frame Time: %.2f", MaxFrameTime);
RDebug_Printf(" ");
frames = 0;
} else frames++;
vboUploads = 0;
draw = 0;
render = 0;
matfx = 0;
skin = 0;
AsciiToUnicode(temp, wtemp);
CFont::SetColor(CRGBA(255, 255, 255, 255));
#ifndef MASTER