aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLContextImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-08-29 17:44:34 +0200
committerSven Gothel <[email protected]>2015-08-29 17:44:34 +0200
commit99a064327bf991318841c858d21d13e55d6b39db (patch)
tree499bbd046b0e22f59e1938361440655a300e00b7 /src/jogl/classes/jogamp/opengl/GLContextImpl.java
parent17af6ed1d0f60c111079ff19c4114fefbfd025fc (diff)
Bug 1203: Implement regular EGL OpenGL Profile probing (ES* + GL*)
- GLProfile - Add 'hasGL234OnEGLImpl' handling, i.e. GL* profiles on EGL devices - Properly handle EGL's 'GLDynamicLookupHelper' queries for ES2, ES1 and GL* profiles, i.e. allow each one to fail seperately. - Merge computed EGL-Profile-Map (1) and Desktop-Profile-Map (2) per device, instead of just using the last computation, preserving and favoratizing the Desktop-Profile-Map. - GLContextImpl.mapGLVersions(..): Map ES* profiles if having an EGLGraphicsDevice and not disabled via GLProfile.disableOpenGLES. - EGLContext - createContextARBImpl(..): Use the EGL_CONTEXT_MINOR_VERSION_KHR if supported - GLContext* accessibility: Remove unused entries, add newly used ones - EGLDrawableFactory - Fix a bug regarding detection of 'OpenGL' API for EGL - SharedResource: Use detailed knowledge of each profile - Only create one drawable and context for probing maximum, utilizing 'GLContextImpl.MappedGLVersionListener' to detect all mapped profiles for 'SharedResource' instance. - Detect whether the probed/mapped device can be mapped to the default-EGL-device, i.e.: - current device is not the default-EGL-device - default-EGL-device is valid and could be mapped (beforehand) - same connection In this case, no probing/mapping is performed and the default-EGL-device mapped data being reused and remapped to the requested device. - When mapping/probing, attempt to use a surfaceless context first, allowing same codepath for default-EGL-device and native-device (X11, ..). This avoids using pbuffer if using default-EGL-device and a dummy onscreen window if using a native-device (X11, ..). If this fails, continue as usual .. - default-EGL-device -> pbuffer - native-device (X11, ..) -> dummy onscreen window
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index dcab9ed5b..fff6d58e0 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1128,6 +1128,40 @@ public abstract class GLContextImpl extends GLContext {
boolean hasGL2 = false;
boolean hasGL4 = false;
boolean hasGL3 = false;
+ boolean hasES3 = false;
+ boolean hasES2 = false;
+ boolean hasES1 = false;
+
+ if( (device instanceof EGLGraphicsDevice) && !GLProfile.disableOpenGLES ) {
+ if( !hasES3) {
+ hasES3 = createContextARBMapVersionsAvailable(device, 3, CTX_PROFILE_ES); // ES3
+ success |= hasES3;
+ if( hasES3 ) {
+ if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) {
+ // Map hw-accel ES3 to all lower core profiles: ES2
+ mapAvailableGLVersion(device, 2, CTX_PROFILE_ES, ctxVersion, ctxOptions, glRendererQuirks);
+ if( PROFILE_ALIASING ) {
+ hasES2 = true;
+ }
+ }
+ resetStates(false); // clean context states, since creation was temporary
+ }
+ }
+ if( !hasES2) {
+ hasES2 = createContextARBMapVersionsAvailable(device, 2, CTX_PROFILE_ES); // ES2
+ success |= hasES2;
+ if( hasES3 ) {
+ resetStates(false); // clean context states, since creation was temporary
+ }
+ }
+ if( !hasES1) {
+ hasES1 = createContextARBMapVersionsAvailable(device, 1, CTX_PROFILE_ES); // ES1
+ success |= hasES1;
+ if( hasES1 ) {
+ resetStates(false); // clean context states, since creation was temporary
+ }
+ }
+ }
// Even w/ PROFILE_ALIASING, try to use true core GL profiles
// ensuring proper user behavior across platforms due to different feature sets!