|
|
Subscribe / Log in / New account

X: 25 years and still lacking vsync'ed double buffering

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 1, 2009 19:10 UTC (Thu) by oak (guest, #2786)
In reply to: X: 25 years and still lacking vsync'ed double buffering by dion
Parent article: LPC: 25 years of X

Well, I think vsynching the X screen is the trivial issue as that's only a
small piece of the tear-free graphics puzzle. You need to sync every
thing in this chain with each other: application / GUI toolkit-> app
window composite buffer -> composite manager -> X screen -> monitor.

Things could get more complicated to implement when some windows are using
OpenGL for updating the content (i.e. use something else than CPU to
update it), some use Xvideo, some different GUI toolkits. These should
then be suppored by different composite managers (or window manager if one
isn't using composite manager) one can be using. And somebody above
mentioned also xinerama...

At least it's going to eat truckloads of extra memory.


to post comments

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 1, 2009 20:25 UTC (Thu) by dion (guest, #2764) [Link] (4 responses)

Well, tearing refers to the problem you see when someone updates the on-screen image while it's being sent to the screen, thus showing some of the old and the new frame for a while.

If all drawing to the screen happens to a back buffer and that buffer is only flipped into view during retrace then tearing cannot happen.

You are entirely correct that the entire rendering chain has to be synchronized and driven by the retrace, if you want the best possible result, but it would help a great deal if X could simply stay away from the on-screen buffer until there was a retrace.

Tearing is by far the most nasty artifact that comes from sloppy graphics work, but an application that jumps between full framerate and half framerate (say 70 and 35 Hz) looks almost as bad, so setting up a proper synchronized rendering chain would certainly be worth doing.

I don't think any of this would have to eat truck loads of memory, though, you'd certainly need to have a number (3 or more) frames buffered, but that's nothing compared to the memory on common graphics cards these days.

The buffering might not have to happen for the entire screen, you could easily have a single application (a video player, perhaps) that's the only thing that really needs to sync to vtrace and run at a fixed framerate to look good, that single app. could have a deep set of buffers, everything else could get by with the global tripple bufer.

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 1, 2009 20:32 UTC (Thu) by dlang (guest, #313) [Link] (3 responses)

actually, I thought that tearing referred to the problem that (especially on older, cheaper video cards) if you updated the screen while it was being drawn it corrupted the video output so that the screen sync failed. The better video cards used dual-ported ram that could be accessed by two chips at the same time so that it could be updated and read without causing tearing.

just displaying part of the old image and part of the new image is not the same thing.

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 2, 2009 18:26 UTC (Fri) by dion (guest, #2764) [Link]

That's a new definition for me.

It doesn't matter what it's called though, doing updates to the screen at any other time that during vsync looks like ass.

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 2, 2009 21:03 UTC (Fri) by hrydgard (guest, #54085) [Link]

That's a new one - never heard of that problem, unless it's related to
"snow", which would happen if you changed the palette during parts of the
frame under various EGA and VGA graphics modes and has similar causes.

X: 25 years and still lacking vsync'ed double buffering

Posted Oct 2, 2009 23:09 UTC (Fri) by cortana (subscriber, #24596) [Link]

Here's a picture illustrating the effects of tearing:

http://forum.i3d.net/attachments/technische-hulp-cod4/943...


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds