mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-17 01:21:12 +00:00
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:
parent
6e5cf7ee08
commit
45cc75d2d9
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue