Closed Bug 689419 Opened 13 years ago Closed 1 year ago

Synchronize rendering to vblank with GLX

Categories

(Core :: Graphics, defect)

All
Linux
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: cjones, Unassigned)

References

Details

The right way to do this appears to be setting glXSwapIntervalSGI(1).  See http://www.opengl.org/registry/specs/SGI/swap_control.txt and http://www.opengl.org/wiki/Swap_Interval.

This should be a fairly straightforward patch to GLContextProviderGL.
Summary: Synchronize rendering to vblank → Synchronize rendering to vblank with GLX
Since Canvas2D and WebGL both use <canvas>, and requestAnimationFrame() is now used as one method for Chrome/Webkit to run WebGL to VSYNC, it's worth linking this bug to this one as well:
https://bugzilla.mozilla.org/show_bug.cgi?id=707884
A swap interval of 1 is the default in Mesa [1] and configurable through driconf [2].

That sounds good for windows that are not composited.
For composited windows it has the disadvantage of increasing latency by a full frame, expect perhaps where it might be able to race/jitter in ahead of the compositor in some rare situations (Bug 856427 comment 18).

If the compositing manager supports extended frame synchronization [3], indicated by _NET_WM_FRAME_DRAWN, then the application would be better to use a single-buffered window and composite layers in response to _NET_WM_FRAME_DRAWN.

[1] http://cgit.freedesktop.org/mesa/mesa/tree/src/glx/dri2_glx.c?id=mesa-9.1.1#n370
[2] http://dri.freedesktop.org/wiki/ConfigurationOptions#Synchronization_with_vertical_refresh_.28swap_intervals.29
[3] http://fishsoup.net/misc/wm-spec-synchronization.html#idp5082256
(In reply to Karl Tomlinson (:karlt) from comment #2)
> If the compositing manager supports extended frame synchronization [3],
> indicated by _NET_WM_FRAME_DRAWN, then the application would be better to
> use a single-buffered window and composite layers in response to
> _NET_WM_FRAME_DRAWN.

Hmm.  Seems this may not yet work correctly with NVIDIA GLX.
https://mail.gnome.org/archives/wm-spec-list/2013-April/msg00003.html
https://mail.gnome.org/archives/wm-spec-list/2011-November/msg00002.html et seq.
Severity: normal → S3

Do you think this bug is still relevant?

Flags: needinfo?(stransky)

We're moving to EGL.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(stransky)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.