Bug 891

Summary: Enhance GLCapabilities-Query from native Configuration (EGL, GLX, WGL) / General Performance
Product: [JogAmp] Jogl Reporter: Sven Gothel <sgothel>
Component: coreAssignee: Sven Gothel <sgothel>
Severity: enhancement CC: sgothel
Priority: ---    
Version: 2   
Hardware: All   
OS: all   
Type: --- SCM Refs:
613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d cf1163fc88976e7087d3a17524a49139e35a4708 6395670886513796b747e7aaef2ebfbbcda7b07e 144b9ef5a433b2a93f5503b1c935c8f7ec61a0de
Workaround: ---
Bug Depends on:    
Bug Blocks: 888, 905    

Description Sven Gothel 2013-11-05 08:59:11 CET
Querying GLCapabilities from native configuration currently explodes into 
multiple xxxGetConfig(..) JNI calls, which utilize NIO buffers.

Using a bulk method will enhance performance.

Further more, add a 'fast path' where we use the recommended native config
as chosen by xxxChooseConfig(..), i.e. only create the chosen GLCapabilities which is being used,
instead of querying all GLCapabilities! This will speed-up the process dramatically.
Comment 1 Sven Gothel 2013-11-05 08:59:58 CET

    X11GLXGraphicsConfiguration.GLXFBConfig2GLCapabilities(..) ran over all FB configs and for each it grabbed
    native config values separately. Fetching them in bulk mode saves around 7% of this function's cost.
    Also reuse XRenderPictFormat instance for 'XRenderDirectFormat XRenderFindVisualFormat(..)' call,
    saving a few NIO creation cycles w/ StructAccessor.
    Biggest savior is X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig()'s
    fast path w/o chooser and usable 1st FBConfig. Here we only issue 'GLXFBConfig2GLCapabilities(..)'
    on the first valid entry.
    Test w/ 50 X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationFBConfig() invocations:
      - pre change:  1.708 ms
      - post change:   650 ms
    Time is no spent almost solely on native glXChooseFBConfig (546ms).
Comment 2 Sven Gothel 2013-11-05 11:05:34 CET

Bug 888 / Bug 891 - Enhance GLCapabilities-Query: Apply changes of commit 613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d to EGL and WGL.
Comment 3 Sven Gothel 2013-11-07 13:39:56 CET
      Fix chosenPFDID -> recommendedIndex (!skipCapsChooser mode)

      Regression of commit cf1163fc88976e7087d3a17524a49139e35a4708:
      Commit dropped seeking recommendedIndex of chosenPFDID within cleaned-up availableCaps
      when in !skipCapsChooser mode.
Comment 4 Sven Gothel 2013-11-07 13:40:17 CET
  GLJPanel: Don't ctor DefaultGLCapabilitiesChooser() if null chooser is passed, this allows native GLCaps/config query to follow fast-path