diff options
author | Sven Gothel <[email protected]> | 2013-10-19 02:49:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-19 02:49:15 +0200 |
commit | 34b35c5a0a379a6b4c0b23b9d347a0b1338f0239 (patch) | |
tree | 7e5df9aead4e988d8d4ca5333b8d18c692eed65a /src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java | |
parent | c6b8ad4a8972f62fb8d0c1dcd7eca1de24393028 (diff) |
Fix Bug 862: Fix GL Version Validation / NVidia GTX550 driver 331.13 - 64bit Linux - No compatibility GLProfile (GL2, >= GL3bc)
Fix GL Version Validation:
We shall not rely on our known good versions when validating a queried GL context version,
but allow some 'room' for a higher version post JOGL release while still
cutting off 'odd versions'.
While GL version detection, we always iterate from the highest known version
down to the lowest. Hence 'GLContext.isValidGLVersion(..)' is satisfied
by validating the lowest version number but allowing a higher than known one.
Now we would return 'invalid' for a version >= 6.
It is enough to clip to the maximum known version when iterating,
allowing the highest unknown version to be available.
GLContext.isValidGLVersion(..):
Returns true, if the major.minor is not inferior to the lowest
valid version and does not exceed the highest known major number by more than one.
The minor version number is ignored by the upper limit validation
and the major version number may exceed by one.
The upper limit check is relaxed since we don't want to cut-off
unforseen new GL version since the release of JOGL.
Hence it is important to iterate through GL version from the upper limit
and 'decrementGLVersion(..)' until invalid.
Add GL Version 4.4 to valid known versions.
Remove ES3 desktop detection, which is impossible
Regression of commit 3a0d7703da32e9a5ddf08a334f18588a78038d88 (ES3 support)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java index b8bcd2e78..8d3d207ee 100644 --- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java +++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java @@ -223,14 +223,13 @@ final class ExtensionAvailabilityCache { final VersionNumber version = context.getGLVersionNumber(); int major[] = new int[] { version.getMajor() }; int minor[] = new int[] { version.getMinor() }; - while (GLContext.isValidGLVersion(ctxOptions, major[0], minor[0])) { + do{ final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0]; availableExtensionCache.add(GL_XX_VERSION); if (DEBUG) { System.err.println(getThreadName() + ":ExtensionAvailabilityCache: Added "+GL_XX_VERSION+" to known extensions"); } - if(!GLContext.decrementGLVersion(ctxOptions, major, minor)) break; - } + } while( GLContext.decrementGLVersion(ctxOptions, major, minor) ); // put a dummy var in here so that the cache is no longer empty even if // no extensions are in the GL_EXTENSIONS string @@ -248,7 +247,7 @@ final class ExtensionAvailabilityCache { private int glExtensionCount = 0; private String glXExtensions = null; private int glXExtensionCount = 0; - private HashSet<String> availableExtensionCache = new HashSet<String>(50); + private final HashSet<String> availableExtensionCache = new HashSet<String>(50); static String getThreadName() { return Thread.currentThread().getName(); } |