[client] main: let the renderer know if it's rendering a whole new frame

While the renderer can internally track this it would be better to
simply provide this information to the renderer directly so it can make
better decisions on how best to update the screen.
This commit is contained in:
Geoffrey McRae
2021-07-21 17:26:48 +10:00
parent 8cf444ef31
commit 6389a06903
4 changed files with 10 additions and 4 deletions

View File

@@ -191,8 +191,14 @@ static int renderThread(void * unused)
atomic_compare_exchange_weak(&g_state.lgrResize, &resize, 0);
}
static uint64_t lastFrameCount = 0;
const uint64_t frameCount =
atomic_load_explicit(&g_state.frameCount, memory_order_relaxed);
const bool newFrame = frameCount != lastFrameCount;
lastFrameCount = frameCount;
LG_LOCK(g_state.lgrLock);
if (!g_state.lgr->render(g_state.lgrData, g_params.winRotate))
if (!g_state.lgr->render(g_state.lgrData, g_params.winRotate, newFrame))
{
LG_UNLOCK(g_state.lgrLock);
break;