Fix Sync timer for timedemo "twice" mode and remove unneeded timings in TimeRenderDemo()

This commit is contained in:
Stephen Saunders 2023-06-20 22:25:24 -04:00
parent 4110dc1f05
commit 4f6f23e8ac
2 changed files with 2 additions and 4 deletions

View file

@ -312,13 +312,11 @@ void idCommonLocal::TimeRenderDemo( const char* demoName, bool twice, bool quit
while( readDemo )
{
BusyWait(); // SRS - BusyWait() calls UpdateScreen() which draws and renders out-of-sequence but still supports frame timing
commonLocal.frameTiming.finishSyncTime_EndFrame = Sys_Microseconds();
commonLocal.mainFrameTiming = commonLocal.frameTiming;
// ** End of current logical frame **
// ** Start of next logical frame **
commonLocal.frameTiming.startSyncTime = Sys_Microseconds();
commonLocal.frameTiming.finishSyncTime = commonLocal.frameTiming.startSyncTime;
commonLocal.frameTiming.finishSyncTime = Sys_Microseconds();
commonLocal.frameTiming.startGameTime = commonLocal.frameTiming.finishSyncTime;
AdvanceRenderDemo( true ); // SRS - Advance demo commands to manually run the next game frame during first pass of the timedemo

View file

@ -437,10 +437,10 @@ void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse )
}
// this should exit right after vsync, with the GPU idle and ready to draw
frameTiming.startRenderTime = Sys_Microseconds(); // SRS - Added frame timing for out-of-sequence updates (e.g. used in timedemo "twice" mode)
const emptyCommand_t* cmd = renderSystem->SwapCommandBuffers( &time_frontend, &time_backend, &time_shadows, &time_gpu, &stats_backend, &stats_frontend );
// get the GPU busy with new commands
frameTiming.startRenderTime = Sys_Microseconds(); // SRS - Added frame timing for out-of-sequence updates (e.g. used in timedemo "twice" mode)
renderSystem->RenderCommandBuffers( cmd );
frameTiming.finishRenderTime = Sys_Microseconds(); // SRS - Added frame timing for out-of-sequence updates (e.g. used in timedemo "twice" mode)