Tearing in a fixed area of the screen, possibly…? If so, that’s
because of the way most drivers implement page “flipping” on XFree86.
It’s actually driver specific - although XFree86 isn’t exactly helpful
when it comes to implementing this feature in drivers.
As it is, most OpenGL drivers render into an off-screen buffer which
is then copied to the screen with a h/w blit. Doing that without
tearing requires careful coding; make sure the blitter is ready to
start instantly before doing the retrace sync, and DO NOT blit rows
from the bottom to the top. Also, sync as early as possible; ie at
the start of the retrace; not the end. All drivers I’ve seen so far
get one or more of those things wrong. For reliable results, you also
need a real time OS, since timing is very critical, compared to
doing it with h/w pageflipping.
The proper method is to set up N h/w pages (N > 1) and just swap
pointers some time after sync’ing with the retrace. (Which is what
most Windows drivers do.) Nothing happens until the card reads the
pointers before displaying the next frame, so there can be no
tearing, even if the driver loses the CPU for half a frame right
after the retrace sync.
Anyway, this is the… uhm, I’ve lost count! I feel like a broken
record…
Can we put this "why vsync in Linux just makes the tearing worse"
story in some FAQ somewhere?
BTW, anyone who’s more up to date with XFree86 than I am ATM; why
can’t DRI use DGA internally for fullscreen modes? Seems like the
code to set up actual full screen modes (as opposed to changing the
resolution of the desktop) is in place, but it’s not accessible when
it’s really needed.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Thursday 09 October 2003 01.01, MC wrote:
Darn,
This vertical synk thing dosn’t seem to work at all, I still
experience a great amount of tearing in my game. Under windows, I
don’t have this problem. Is it linux speciffic, is v-syncing not
supported?