diff options
author | Sven Gothel <[email protected]> | 2019-08-23 07:25:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-08-23 07:25:53 +0200 |
commit | 21f82eb8b74a60cc8a869e073e124d44c75f217e (patch) | |
tree | c436343eed82c4d3db149d452ab3a3f6a1e01c73 /src/jogl/classes | |
parent | bd4be8b54a43b95d7dec90f6dbd0905987ad7605 (diff) |
Bug 1383: Tighten version/profile qualification: fail if: requested compat profile && has core profile
On Mesa, if requesting a 3.1 compat profile, we receive a 4.5 core profile.
This is natural due to constraints within glXCreateContextAttribsARB,
i.e. GLX_CONTEXT_PROFILE_MASK_ARB is only a available for versions >= 3.2
and these are not available on Mesa.
Tested with Mesa 18.3.6 of Debian 10 Buster,
which also confirms Bug 1385 fix of limitating GL3CompatNonCompliant
to Mesa < 18.2.0
Diffstat (limited to 'src/jogl/classes')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 5f5823801..72a6b0b4e 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1860,6 +1860,7 @@ public abstract class GLContextImpl extends GLContext { // Relaxed match for versions ( !isES && major < 3 ) requests, last resort! // Otherwise: // - fail if hasVersion < reqVersion (desktop and ES) + // - fail if requested compat && has core profile (desktop) // - fail if ES major-version mismatch: // - request 1, >= 3 must be equal // - request 2 must be [2..3] @@ -1867,6 +1868,7 @@ public abstract class GLContextImpl extends GLContext { final int _hasMajor = hasGLVersionByInt.getMajor(); if( strictMatch && ( ( ( isESReq || reqMajor >= 3 ) && hasGLVersionByInt.compareTo(reqGLVersion) < 0 ) || + ( !isESReq && 0 != ( reqCtxProfileBits & GLContext.CTX_PROFILE_COMPAT ) && 0 != ( hasCtxProfileBits & GLContext.CTX_PROFILE_CORE ) ) || ( isESReq && ( ( 2 == reqMajor && ( 2 > _hasMajor || _hasMajor > 3 ) ) || // 2 -> [2..3] @@ -1876,7 +1878,9 @@ public abstract class GLContextImpl extends GLContext { ) ) { if(DEBUG) { System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (Int): requested "+ - GLContext.getGLVersion(reqMajor, reqMinor, reqCtxProfileBits, null)+" -> has "+glVersion+", "+hasGLVersionByInt); + GLContext.getGLVersion(reqMajor, reqMinor, reqCtxProfileBits, null)+ + " -> has "+glVersion+", "+hasGLVersionByInt+" - "+ + GLContext.getGLVersion(glIntMajor[0], glIntMinor[0], hasCtxProfileBits, null)); } return false; } @@ -1912,6 +1916,7 @@ public abstract class GLContextImpl extends GLContext { // Relaxed match for versions ( !isES && major < 3 ) requests, last resort! // Otherwise: // - fail if hasVersion < reqVersion (desktop and ES) + // - fail if requested compat && has core profile (desktop) // - fail if ES major-version mismatch: // - request 1, >= 3 must be equal // - request 2 must be [2..3] @@ -1919,6 +1924,7 @@ public abstract class GLContextImpl extends GLContext { final int _hasMajor = hasGLVersionByString.getMajor(); if( strictMatch && ( ( ( isESReq || reqMajor >= 3 ) && hasGLVersionByString.compareTo(reqGLVersion) < 0 ) || + ( !isESReq && 0 != ( reqCtxProfileBits & GLContext.CTX_PROFILE_COMPAT ) && 0 != ( hasCtxProfileBits & GLContext.CTX_PROFILE_CORE ) ) || ( isESReq && ( ( 2 == reqMajor && ( 2 > _hasMajor || _hasMajor > 3 ) ) || // 2 -> [2..3] @@ -1928,7 +1934,9 @@ public abstract class GLContextImpl extends GLContext { ) ) { if(DEBUG) { System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (String): requested "+ - GLContext.getGLVersion(reqMajor, reqMinor, reqCtxProfileBits, null)+" -> has "+glVersion+", "+hasGLVersionByString); + GLContext.getGLVersion(reqMajor, reqMinor, reqCtxProfileBits, null)+ + " -> has "+glVersion+", "+hasGLVersionByString+" - "+ + GLContext.getGLVersion(hasGLVersionByString.getMajor(), hasGLVersionByString.getMinor(), hasCtxProfileBits, null)); } return false; } |