Bug 1202

Summary: Add support of Adaptive Vsync via [GLX|WGL]_EXT_swap_control_tear
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement CC: sgothel
Priority: ---    
Version: 2.3.2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
deff49c901915e007f43a1df1a0d217a786e9f06 6ab634654f58afcf4549fcd1a796a0f9fd13298c 1d1b3f92a7c8021198e44bc4b2d6494ab789ddd3 aacc8afdca0b1376f91dcc68aa3ae3b39c7aba51
Workaround: ---

Description Sven Gothel 2015-08-27 12:35:52 CEST
[GLX|WGL]_EXT_swap_control_tear extensions support
asynchronous buffer swaps, i.e. adaptive Vsync.

<https://www.opengl.org/wiki/SwapInterval_aka_vsync#Adaptive_Vsync>
<https://www.opengl.org/registry/specs/EXT/wgl_swap_control_tear.txt>
<https://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt>

<http://keithp.com/blogs/async_flip/>

The extensions utilizes a negative interval value,
enabling late swaps to occur without synchronization to the video frame.

Hence '-1' has new semantics, previously it was the 'default value'
of 'untouched vsync interval'.

New default is:
  - 0 for unrealized context
  - 1 for realized context

+++

It requires [GLX|WGL]_EXT_swap_control,
hence we shall ensure to use use this extension 
in the implementation of GLContext.setSwapInterval(..).

+++
Comment 1 Sven Gothel 2015-08-27 20:05:35 CEST
deff49c901915e007f43a1df1a0d217a786e9f06
  - Fixed as described

6ab634654f58afcf4549fcd1a796a0f9fd13298c
  - Move GLContextImpl.*SwapInterval* into its own section
Comment 2 Sven Gothel 2015-08-30 02:46:22 CEST
commit 1d1b3f92a7c8021198e44bc4b2d6494ab789ddd3
    Bug 1202 (related): Fix SEMVER regressions mostly due to Bug 1202 commits (adding dummy methods)

    Commits deff49c901915e007f43a1df1a0d217a786e9f06 and 6ab634654f58afcf4549fcd1a796a0f9fd13298c
    changed/removed a few protected methods of public classes ..

    Re-added dummy methods .. shall be removed for next 2.4.* version
Comment 3 Sven Gothel 2015-09-01 02:07:17 CEST
aacc8afdca0b1376f91dcc68aa3ae3b39c7aba51

    Bug 1202: Fix vsync regression on OSX when using CALayer
    
    On OSX using CALayer for onscreen rendering,
    the drawable is utilizing an offscreen FBO.
    
    Hence we need to move the vsync-skip-operation criteria,
    i.e. skip if offscreen, down to the implementation.