Vertical retrace sync for OpenGL on Mac OS X

I just submitted a patch that enables vertical retrace synchronization
for OpenGL on Mac OS X: https://bugzilla.libsdl.org/show_bug.cgi?id=117

If anyone thinks this is a bad idea or has any other opinion on it,
please comment.

-Christian

Hello !

I just submitted a patch that enables vertical retrace synchronization
for OpenGL on Mac OS X: https://bugzilla.libsdl.org/show_bug.cgi?id=117

If anyone thinks this is a bad idea or has any other opinion on it,
please comment.

It would be cool to have something like this in SDL,
but it should be default to off and the user
should be able to select it at runtime.

CU

Why is it that everyone insists on having sync off (and tearing as a
result) as the default behavior?

Is it a result of everyone pushing the rendering and detail and
resolutions up so high that the frame rate is below the refresh rate
most of the time? (Because that, and broken time/animation code, are
the only things that can make tearing look better than the
alternative.)

Anyway, I certainly wouldn’t mind having it switchable from the
application where supported.

(On some systems, using single buffered OpenGL is not usable as a
trick to disable sync, as that will actually make the driver render
directly to the screen. Some ATI drivers for Linux do this, for
example - even in windowed mode with overlapping windows.)

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Monday 30 January 2006 20:11, Torsten Giebl wrote:

Hello !

I just submitted a patch that enables vertical retrace
synchronization for OpenGL on Mac OS X:
https://bugzilla.libsdl.org/show_bug.cgi?id=117

If anyone thinks this is a bad idea or has any other opinion on
it, please comment.

It would be cool to have something like this in SDL,
but it should be default to off and the user
should be able to select it at runtime.

Is it a result of everyone pushing the rendering and detail and
resolutions up so high that the frame rate is below the refresh rate
most of the time?

Yes.

Also, tearing at a higher fps is frequently better than an app that
"feels" less responsive, if the bug reports I get are any indication.

And a lot of developers would rather have that CPU time than have the GL
driver spinning waiting on vblank.

Also, benchmark hype pressure in high-end games is a real killer.

Being able to toggle this programmatically (and, ideally, as a check box
in a game’s config menu) is really nice.

–ryan.

Is it a result of everyone pushing the rendering and detail and
resolutions up so high that the frame rate is below the refresh
rate most of the time?

Yes.

Also, tearing at a higher fps is frequently better than an app that
"feels" less responsive, if the bug reports I get are any
indication.

Right, especially with most current and older TFTs. A 600 BHP virtual
mid engine car is hard enough to control without another 17 ms of
latency. :smiley: (And the blurring of a “16 ms” TFT pretty much hides the
tearing anyway.)

And a lot of developers would rather have that CPU time than have
the GL driver spinning waiting on vblank.

The real answer to that is triple buffering - but of course, double
buffering without sync is more widely available.

Either way, there should be no spinning in a serious driver. Only
broken hardware requires that - but then again, there is a lot of
broken hardware out there…

Also, benchmark hype pressure in high-end games is a real killer.

Well, at least it gives us insanely fast video cards. :slight_smile:

(…which in turn further lowers the motivation for disabling retrace
sync by default, especially in games with (relatively) low
requirements.)

Being able to toggle this programmatically (and, ideally, as a check
box in a game’s config menu) is really nice.

Yes.

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Monday 30 January 2006 21:12, Ryan C. Gordon wrote: