mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-05-16 11:31:15 +00:00
[client] main: allow 'catchup' when using jitRender
This commit is contained in:
parent
986f92d0db
commit
695b7b793c
@ -171,13 +171,19 @@ static int renderThread(void * unused)
|
|||||||
if (g_state.jitRender)
|
if (g_state.jitRender)
|
||||||
{
|
{
|
||||||
g_state.ds->waitFrame();
|
g_state.ds->waitFrame();
|
||||||
if (!lgResetEvent(g_state.frameEvent) && !g_state.overlayInput &&
|
|
||||||
!g_state.lgr->needs_render(g_state.lgrData))
|
const uint64_t pending =
|
||||||
|
atomic_load_explicit(&g_state.pendingCount, memory_order_acquire);
|
||||||
|
if (!lgResetEvent(g_state.frameEvent) && !pending && !g_state.overlayInput
|
||||||
|
&& !g_state.lgr->needs_render(g_state.lgrData))
|
||||||
{
|
{
|
||||||
if (g_state.ds->skipFrame)
|
if (g_state.ds->skipFrame)
|
||||||
g_state.ds->skipFrame();
|
g_state.ds->skipFrame();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pending > 0)
|
||||||
|
atomic_fetch_sub(&g_state.pendingCount, 1);
|
||||||
}
|
}
|
||||||
else if (g_params.fpsMin != 0)
|
else if (g_params.fpsMin != 0)
|
||||||
{
|
{
|
||||||
@ -696,7 +702,15 @@ int main_frameThread(void * unused)
|
|||||||
g_state.lastFrameTimeValid = true;
|
g_state.lastFrameTimeValid = true;
|
||||||
|
|
||||||
atomic_fetch_add_explicit(&g_state.frameCount, 1, memory_order_relaxed);
|
atomic_fetch_add_explicit(&g_state.frameCount, 1, memory_order_relaxed);
|
||||||
|
if (g_state.jitRender)
|
||||||
|
{
|
||||||
|
if (atomic_load_explicit(&g_state.pendingCount, memory_order_acquire) < 10)
|
||||||
|
atomic_fetch_add_explicit(&g_state.pendingCount, 1,
|
||||||
|
memory_order_release);
|
||||||
|
}
|
||||||
|
else
|
||||||
lgSignalEvent(g_state.frameEvent);
|
lgSignalEvent(g_state.frameEvent);
|
||||||
|
|
||||||
lgmpClientMessageDone(queue);
|
lgmpClientMessageDone(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ struct AppState
|
|||||||
RingBuffer renderTimings;
|
RingBuffer renderTimings;
|
||||||
RingBuffer frameTimings;
|
RingBuffer frameTimings;
|
||||||
|
|
||||||
|
atomic_uint_least64_t pendingCount;
|
||||||
atomic_uint_least64_t renderCount, frameCount;
|
atomic_uint_least64_t renderCount, frameCount;
|
||||||
_Atomic(float) fps, ups;
|
_Atomic(float) fps, ups;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user