简体   繁体   中英

Disabling VSync in Aero Window

I'm working on a windowed (not full-screen) OpenGL application for Windows (XP, Vista, 7, 8) where VSync and GPU frame queuing cause a very noticeable (and bad) input lag. I've used wglSwapBufferEXT to disable VSync, and a glFinish after SwapBuffers to prevent frame queuing.

The problem is, on versions of Windows with Aero enabled, the input lag still exists. Disabling Aero fixes the issue, but we don't want to force our users to do so. Is there a way to prevent Aero from forcing VSync on our application, or disable Aero just for our application?

Aero is a window compositing system. Compositors by their very nature introduce rendering lag, which may be even 2 frame periods long. The only way to overcome this is, well, disabling the compositor.


About two years ago I did outline a synchronization scheme for X11 Composite based systems, where each program would provide "lap times" about its rendering times. Basically you can't get your lag shorter than the time it takes to render your frame. But if you manage to delay the beginning of rendering a frame as long as possible, integrating user input up to the very start of rendering you get the the shortest possible lag.

The idea was to let the compositor collect timing statistics, how long it takes to composite the windows and how long it takes for each program to render a frame. Then the compositor would give each program a "start rendering now" signal so that the rendering would finish just in time to do composition right before the V-Sync.

I've not implemented this, yet, so far, though.

You can disable Aero while your application is running, using the DwmEnableComposition function. I'm not sure if that's exactly what you meant by "disable Aero just for our application".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM