Bug 891 - Enhance GLCapabilities-Query from native Configuration (EGL, GLX, WGL) / General Performance
Summary: Enhance GLCapabilities-Query from native Configuration (EGL, GLX, WGL) / Gene...
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: All all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks: 888 905
  Show dependency treegraph
 
Reported: 2013-11-05 08:59 CET by Sven Gothel
Modified: 2013-11-17 18:31 CET (History)
1 user (show)

See Also:
Type: ---
SCM Refs:
613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d cf1163fc88976e7087d3a17524a49139e35a4708 6395670886513796b747e7aaef2ebfbbcda7b07e 144b9ef5a433b2a93f5503b1c935c8f7ec61a0de
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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
613e33ee8ffc1f2b9c5db1e1b5bb5253a159ed6d

    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
cf1163fc88976e7087d3a17524a49139e35a4708

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
6395670886513796b747e7aaef2ebfbbcda7b07e:
  WindowsWGLGraphicsConfigurationFactory: 
      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
144b9ef5a433b2a93f5503b1c935c8f7ec61a0de
  GLJPanel: Don't ctor DefaultGLCapabilitiesChooser() if null chooser is passed, this allows native GLCaps/config query to follow fast-path