diff options
author | Sven Gothel <[email protected]> | 2015-08-30 02:30:26 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-30 02:30:26 +0200 |
commit | 3ac457a3a9074a70bf428bb6a5674b8f70d268b1 (patch) | |
tree | 8e2bf74c9345bd8698a4a5ffcd9b365d30a84ed9 /src/jogl/classes/jogamp/opengl/egl | |
parent | 365d273115a98ab38c454608448c6639c45b5f74 (diff) |
Bug 1203: Optimize OpenGL Profile probing/mapping (Skip redundant queries)
Via GLDrawableFactory[Impl] the following details are considered
while GLContextImpl.mapGLVersions(..):
- hasOpenGLDesktopSupport
If false, skip OpenGL Desktop queries
- hasOpenGLESSupport
If false, skip OpenGL ES queries
- hasMajorMinorCreateContextARB
If false, reduce [maxMajor.maxMinor..minMajor.minMinor]
iteration, reducing to [maxMajor..minMajor],
usually only one query.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/egl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLContext.java | 5 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 38 |
2 files changed, 30 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index f0040f989..1910fbe72 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -168,7 +168,7 @@ public class EGLContext extends GLContextImpl { final long eglConfig = config.getNativeConfig(); final EGLDrawableFactory factory = (EGLDrawableFactory) drawable.getFactoryImpl(); - final boolean hasFullOpenGLAPISupport = factory.hasFullOpenGLAPISupport(); + final boolean hasFullOpenGLAPISupport = factory.hasOpenGLDesktopSupport(); final boolean useKHRCreateContext = factory.hasDefaultDeviceKHRCreateContext(); final boolean ctDesktopGL = 0 == ( GLContext.CTX_PROFILE_ES & ctp ); final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ; @@ -177,9 +177,8 @@ public class EGLContext extends GLContextImpl { if(DEBUG) { System.err.println(getThreadName() + ": EGLContext.createContextARBImpl: Start "+getGLVersion(reqMajor, reqMinor, ctp, "@creation") - + ", OpenGL API Support "+factory.hasOpenGLAPISupport() + ", useKHRCreateContext "+useKHRCreateContext - + ", Full OpenGL API Support "+hasFullOpenGLAPISupport + + ", OpenGL API Support "+hasFullOpenGLAPISupport + ", device "+device); } if ( 0 == eglDisplay ) { diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index dc7b35bf2..2e5ee0854 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -899,17 +899,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { return defaultDeviceEGLFeatures.hasKHRCreateContext; } /** - * Method returns {@code true} if {@code EGL_OpenGL_API} is supported, - * otherwise method returns {@code false}. + * {@inheritDoc} + * <p> + * This factory may support native desktop OpenGL if {@link EGL#EGL_CLIENT_APIS} contains {@code OpenGL} + * <i>and</i> if {@code EGL_KHR_create_context} extension is supported. + * </p> */ - public final boolean hasOpenGLAPISupport() { - return defaultDeviceEGLFeatures.hasGLAPI; - } - /** - * Method returns {@code true} if {@code EGL_OpenGL_API} and {@code EGL_KHR_create_context} is supported, - * otherwise method returns {@code false}. - */ - public final boolean hasFullOpenGLAPISupport() { + @Override + public final boolean hasOpenGLDesktopSupport() { /** * It has been experienced w/ Mesa 10.3.2 (EGL 1.4/Gallium) * that even though initial OpenGL context can be created w/o 'EGL_KHR_create_context', @@ -920,6 +917,27 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { defaultDeviceEGLFeatures.hasGLAPI && defaultDeviceEGLFeatures.hasKHRCreateContext; } + /** + * {@inheritDoc} + * <p> + * This factory always supports native GLES profiles. + * </p> + */ + @Override + public final boolean hasOpenGLESSupport() { return true; } + + /** + * {@inheritDoc} + * <p> + * Return true if {@code EGL_KHR_create_context} extension is supported, + * see {@link #hasDefaultDeviceKHRCreateContext()}. + * </p> + */ + @Override + public final boolean hasMajorMinorCreateContextARB() { + return hasDefaultDeviceKHRCreateContext(); + } + @Override public final AbstractGraphicsDevice getDefaultDevice() { return defaultDevice; |