mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-11 09:58:10 +00:00
[client] egl: reworked the streaming texture pipeline
This commit is contained in:
@@ -156,7 +156,7 @@ static int renderThread(void * unused)
|
||||
// if our clock is too far out of sync, resync it
|
||||
// this can happen when switching to/from a TTY, or due to clock drift
|
||||
// we only check this once every 100 frames
|
||||
if (++resyncCheck == 100)
|
||||
if (state.frameTime > 0 && ++resyncCheck == 100)
|
||||
{
|
||||
resyncCheck = 0;
|
||||
|
||||
@@ -209,17 +209,6 @@ static int renderThread(void * unused)
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t nsec = time.tv_nsec + state.frameTime;
|
||||
if (nsec > 1e9)
|
||||
{
|
||||
time.tv_nsec = nsec - 1e9;
|
||||
++time.tv_sec;
|
||||
}
|
||||
else
|
||||
time.tv_nsec = nsec;
|
||||
|
||||
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &time, NULL);
|
||||
|
||||
if (!state.resizeDone && state.resizeTimeout < microtime())
|
||||
{
|
||||
SDL_SetWindowSize(
|
||||
@@ -229,6 +218,20 @@ static int renderThread(void * unused)
|
||||
);
|
||||
state.resizeDone = true;
|
||||
}
|
||||
|
||||
if (state.frameTime > 0)
|
||||
{
|
||||
uint64_t nsec = time.tv_nsec + state.frameTime;
|
||||
if (nsec > 1e9)
|
||||
{
|
||||
time.tv_nsec = nsec - 1e9;
|
||||
++time.tv_sec;
|
||||
}
|
||||
else
|
||||
time.tv_nsec = nsec;
|
||||
|
||||
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &time, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
state.running = false;
|
||||
|
Reference in New Issue
Block a user