summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/GLContextImpl.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-01-23 14:55:11 +0100
committerSven Gothel <[email protected]>2015-01-23 14:55:11 +0100
commit3471ee732ab1b642a37066c70acbb749eb696d21 (patch)
tree16f225075726a1f376c2da725d624e6baa7fef0c /src/jogl/classes/jogamp/opengl/GLContextImpl.java
parentcbdd310351f2eda837e707ba7fa9ac18ff9473e4 (diff)
Bug 1038: Refine handling of GLRendererQuirks.NoARBCreateContext
- GLRendererQuirks.NoARBCreateContext is set static per device - Property GLProfile.disableOpenGLARBContext sets static GLRendererQuirks.NoARBCreateContext - Centralize handling in GLContextImpl.createContextARB(..)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index b6db1813f..e2a35efb1 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -922,7 +922,15 @@ public abstract class GLContextImpl extends GLContext {
*/
protected final long createContextARB(final long share, final boolean direct)
{
- if( GLProfile.disableOpenGLARBContext ) {
+ if( GLProfile.disableOpenGLARBContext ||
+ GLRendererQuirks.existStickyDeviceQuirk(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(),
+ GLRendererQuirks.NoARBCreateContext) ) {
+ if( DEBUG ) {
+ System.err.println(getThreadName() + ": createContextARB: Disabled "+
+ "- property disableOpenGLARBContext "+ GLProfile.disableOpenGLARBContext +
+ ", quirk NoARBCreateContext "+GLRendererQuirks.existStickyDeviceQuirk(drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(),
+ GLRendererQuirks.NoARBCreateContext));
+ }
return 0;
}
final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
@@ -937,7 +945,7 @@ public abstract class GLContextImpl extends GLContext {
final GLProfile glp = glCaps.getGLProfile();
if ( !GLContext.getAvailableGLVersionsSet(device) ) {
- if(!mapGLVersions(device)) {
+ if( !mapGLVersions(device) ) {
// none of the ARB context creation calls was successful, bail out
return 0;
}
@@ -1861,6 +1869,22 @@ public abstract class GLContextImpl extends GLContext {
}
}
}
+ if( GLProfile.disableOpenGLARBContext ) {
+ final int quirk = GLRendererQuirks.NoARBCreateContext;
+ if(DEBUG) {
+ System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: disabled");
+ }
+ quirks.addQuirk( quirk );
+ if( withinGLVersionsMapping ) {
+ // Thread safe due to single threaded initialization!
+ GLRendererQuirks.addStickyDeviceQuirk(adevice, quirk);
+ } else {
+ // FIXME: Remove when moving EGL/ES to ARB ctx creation
+ synchronized(GLContextImpl.class) {
+ GLRendererQuirks.addStickyDeviceQuirk(adevice, quirk);
+ }
+ }
+ }
//
// OS related quirks
@@ -1951,6 +1975,10 @@ public abstract class GLContextImpl extends GLContext {
System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", [Vendor "+glVendor+", Renderer "+glRenderer+" and Version "+glVersion+"]");
}
quirks.addQuirk( quirk );
+ if( withinGLVersionsMapping ) {
+ // Thread safe due to single threaded initialization!
+ GLRendererQuirks.addStickyDeviceQuirk(adevice, quirk);
+ }
}
}
} else if( isDriverIntel && glRenderer.equals("Intel Bear Lake B") ) {