From bd4be8b54a43b95d7dec90f6dbd0905987ad7605 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 22 Aug 2019 20:02:54 +0200 Subject: Bug 1383: Final fix: Always test GL3CompatNonCompliant and test on requested version/profile, also .. also, if requested version is within GL3CompatNonCompliant valid range, i.e. < 3.1, the detected actual version will be clipped for valid mapping to the requested data. Here it might be essential to know, that all versions are being 'scanned' via mapGLVersions from high to low. Therefor Version 3.0 would be tried before 2.0 and both will be mapped to the clipped actual version 3.0. The true actual version could be the maximum, however, using the very same would lead to trying an invalid unavailable GLProfile. --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 54051e572..5f5823801 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1977,8 +1977,8 @@ public abstract class GLContextImpl extends GLContext { reqMajor, reqMinor, reqCtxProfileBits, hasMajor, hasMinor, hasCtxProfileBits, vendorVersion, withinGLVersionsMapping); - if( strictMatch && glRendererQuirks.exist(GLRendererQuirks.GL3CompatNonCompliant) && - 0 != ( hasCtxProfileBits & GLContext.CTX_PROFILE_COMPAT) && (hasMajor > 3 || (hasMajor == 3 && hasMinor >= 1)) + if( glRendererQuirks.exist(GLRendererQuirks.GL3CompatNonCompliant) && + 0 != ( reqCtxProfileBits & GLContext.CTX_PROFILE_COMPAT) && (reqMajor > 3 || (reqMajor == 3 && reqMinor >= 1)) ) { if(DEBUG) { @@ -1988,6 +1988,20 @@ public abstract class GLContextImpl extends GLContext { return false; } + if( glRendererQuirks.exist(GLRendererQuirks.GL3CompatNonCompliant) && + reqMajor > 0 && + 0 != ( hasCtxProfileBits & GLContext.CTX_PROFILE_COMPAT) && (hasMajor > 3 || (hasMajor == 3 && hasMinor >= 1)) + ) + { + // Clip actual OpenGL version to be mapped for requested profile/version mapping + hasMajor = reqMajor; + hasMinor = reqMinor; + if(DEBUG) { + System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: GL3CompatNonCompliant: "+ + GLContext.getGLVersion(hasMajor, hasMinor, hasCtxProfileBits, glVersion)+", "+glRenderer); + } + } + contextFQN = getContextFQN(adevice, hasMajor, hasMinor, hasCtxProfileBits); if (DEBUG) { System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.0 validated FQN: "+contextFQN+" - "+ -- cgit v1.2.3