mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
Merge branch 'more-stats' into 'next'
Add tic and UI times to render stats See merge request STJr/SRB2!1125
This commit is contained in:
commit
982435cf86
4 changed files with 26 additions and 2 deletions
|
@ -5433,11 +5433,15 @@ void TryRunTics(tic_t realtics)
|
|||
{
|
||||
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic));
|
||||
|
||||
rs_tictime = I_GetTimeMicros();
|
||||
|
||||
G_Ticker((gametic % NEWTICRATERATIO) == 0);
|
||||
ExtraDataTicker();
|
||||
gametic++;
|
||||
consistancy[gametic%BACKUPTICS] = Consistancy();
|
||||
|
||||
rs_tictime = I_GetTimeMicros() - rs_tictime;
|
||||
|
||||
// Leave a certain amount of tics present in the net buffer as long as we've ran at least one tic this frame.
|
||||
if (client && gamestate == GS_LEVEL && leveltime > 3 && neededtic <= gametic + cv_netticbuffer.value)
|
||||
break;
|
||||
|
|
20
src/d_main.c
20
src/d_main.c
|
@ -495,6 +495,8 @@ static void D_Display(void)
|
|||
lastdraw = false;
|
||||
}
|
||||
|
||||
rs_uitime = I_GetTimeMicros();
|
||||
|
||||
if (gamestate == GS_LEVEL)
|
||||
{
|
||||
ST_Drawer();
|
||||
|
@ -504,6 +506,10 @@ static void D_Display(void)
|
|||
else
|
||||
F_TitleScreenDrawer();
|
||||
}
|
||||
else
|
||||
{
|
||||
rs_uitime = I_GetTimeMicros();
|
||||
}
|
||||
}
|
||||
|
||||
// change gamma if needed
|
||||
|
@ -544,6 +550,8 @@ static void D_Display(void)
|
|||
|
||||
CON_Drawer();
|
||||
|
||||
rs_uitime = I_GetTimeMicros() - rs_uitime;
|
||||
|
||||
//
|
||||
// wipe update
|
||||
//
|
||||
|
@ -657,8 +665,12 @@ static void D_Display(void)
|
|||
V_DrawThinString(30, 60, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "sdrw %d", rs_hw_spritedrawtime / divisor);
|
||||
V_DrawThinString(30, 70, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "fin %d", rs_swaptime / divisor);
|
||||
snprintf(s, sizeof s - 1, "ui %d", rs_uitime / divisor);
|
||||
V_DrawThinString(30, 80, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "fin %d", rs_swaptime / divisor);
|
||||
V_DrawThinString(30, 90, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "tic %d", rs_tictime / divisor);
|
||||
V_DrawThinString(30, 105, V_MONOSPACE | V_GRAYMAP, s);
|
||||
if (cv_glbatching.value)
|
||||
{
|
||||
snprintf(s, sizeof s - 1, "bsrt %d", rs_hw_batchsorttime / divisor);
|
||||
|
@ -691,8 +703,12 @@ static void D_Display(void)
|
|||
V_DrawThinString(30, 50, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "mskd %d", rs_sw_maskedtime / divisor);
|
||||
V_DrawThinString(30, 60, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "fin %d", rs_swaptime / divisor);
|
||||
snprintf(s, sizeof s - 1, "ui %d", rs_uitime / divisor);
|
||||
V_DrawThinString(30, 70, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "fin %d", rs_swaptime / divisor);
|
||||
V_DrawThinString(30, 80, V_MONOSPACE | V_YELLOWMAP, s);
|
||||
snprintf(s, sizeof s - 1, "tic %d", rs_tictime / divisor);
|
||||
V_DrawThinString(30, 95, V_MONOSPACE | V_GRAYMAP, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,9 @@ extracolormap_t *extra_colormaps = NULL;
|
|||
// Render stats
|
||||
int rs_prevframetime = 0;
|
||||
int rs_rendercalltime = 0;
|
||||
int rs_uitime = 0;
|
||||
int rs_swaptime = 0;
|
||||
int rs_tictime = 0;
|
||||
|
||||
int rs_bsptime = 0;
|
||||
|
||||
|
|
|
@ -82,7 +82,9 @@ extern consvar_t cv_renderstats;
|
|||
|
||||
extern int rs_prevframetime;// time when previous frame was rendered
|
||||
extern int rs_rendercalltime;
|
||||
extern int rs_uitime;
|
||||
extern int rs_swaptime;
|
||||
extern int rs_tictime;
|
||||
|
||||
extern int rs_bsptime;
|
||||
|
||||
|
|
Loading…
Reference in a new issue