[Development] Late API addition in QScreen for 5.0

Samuel Rødal samuel.rodal at nokia.com
Fri May 4 16:22:13 CEST 2012

On 05/04/2012 04:03 PM, ext Christoph Feck wrote:
> On Friday 04 May 2012 13:37:04 Samuel Rødal wrote:
>> Hello,
>> to be able to achieve smooth animations in QML 2, the animations
>> should ideally use a fixed timestep, and not a timer which might
>> have inaccuracies depending on the platform and won't give fully
>> smooth results.
> Does OpenGL 2 have API to drive animations by vertical blanking 
> interrupts instead of using a timer? From my experience with movie 
> players, you always get tearing or stuttering, if the frame rate of 
> the display is not a 100% exact multiple of that of the animation or 
> the video.

No, there's not any API in OpenGL for that. It's all very windowing
system and graphics driver dependent.

I believe Mac OS X doesn't have any tearing, correct me if I'm wrong though.

On Linux, it's all up to the graphics driver in my experience. With the
binary Nvidia driver the only reliable way I've seen of enabling vsync
has been to do "export __GL_SYNC_TO_VBLANK=1" before launching an
application. AMD's Catalyst control panel now has an option called "Tear
Free Desktop" which is supposed to also sync rendering, but when I've
tried it I've still gotten tearing, just now it's in the same location
each frame, which looks even worse.

As for the open source drivers I don't know of any reliable way of
enabling vsync. There's the GLX_SGI_video_sync extension which is
supposed to give a uniform way to sync rendering regardless of graphics
driver, but when I've tried it I've gotten the same tearing in a single
location issue as described above.

So the situation isn't quite yet ideal on desktop Linux, though maybe
it's about putting some more pressure on the driver guys to fix the
issue on their side.

I know one of the goals of Wayland has been to fix this mess, quoting
Wikipedia: His stated goal was a system in which "every frame is
perfect, by which I mean that applications will be able to control the
rendering enough that we'll never see tearing, lag, redrawing or flicker."

Not sure about the situation on Windows.


More information about the Development mailing list