Add an undocumented option for forcing busy waits.

Some people complained about the usage of non busy waits:

  * I was told that there's an input lag with nanosleep(). I still doubt
    that, but since the problem is easy to solve...
  * Some Intel CPUs throttle the GPU if the selected CPU pstate is too
    low. This is especially a problem on Haswell mobile CPUs. Keeping
    a core busy works around that.
This commit is contained in:
Yamagi Burmeister 2017-03-13 13:39:03 +01:00
parent 6e5cf7ee08
commit 45cc75d2d9

View file

@ -39,7 +39,10 @@ main(int argc, char **argv)
int time, oldtime, newtime;
int verLen, i;
const char* versionString;
#ifndef BUSY_WAIT
struct timespec t;
#endif
/* register signal handler */
registerHandler();
@ -131,9 +134,11 @@ main(int argc, char **argv)
/* find time spent rendering last frame */
do
{
#ifndef BUSY_WAIT
/* Sleep 10 microseconds */
t.tv_nsec = 10000;
nanosleep(&t, NULL);
#endif
newtime = Sys_Milliseconds();
time = newtime - oldtime;