aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-04-03 21:16:16 +0000
committerKenneth Russel <[email protected]>2006-04-03 21:16:16 +0000
commitd7b298938af58a4243badd9d90da2efa75c8923a (patch)
treee98143844091c0543500331418d030fcf99f86f8 /src
parentacc1f623c1aaf45efc18c6f38dc03d18ed6dc4e5 (diff)
Added workaround for apparent problem with ATI's proprietary drivers
where GL calls seem to result in GLX tokens being sent even for direct contexts, necessitating disabling of optimized on-screen context handling git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@701 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLContext.java5
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java18
2 files changed, 23 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
index b6c4fbfcd..0ed5eaebb 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLContext.java
@@ -298,6 +298,11 @@ public abstract class X11GLContext extends GLContextImpl {
throw new GLException("Should not call this");
}
+ public boolean isOptimizable() {
+ return (super.isOptimizable() &&
+ !X11GLDrawableFactory.getX11Factory().isVendorATI());
+ }
+
//----------------------------------------------------------------------
// Internals only below this point
//
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
index 257fdab6e..9ba591e5f 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
@@ -56,6 +56,11 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
// There is currently a bug on Linux/AMD64 distributions in glXGetProcAddressARB
private static boolean isLinuxAMD64;
+ // ATI's proprietary drivers apparently send GLX tokens even for
+ // direct contexts, so we need to disable the context optimizations
+ // in this case
+ private static boolean isVendorATI;
+
static {
// See DRIHack.java for an explanation of why this is necessary
DRIHack.begin();
@@ -444,6 +449,13 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
System.err.println("!!! GLX client version: " +
GLX.glXGetClientString(display, GLX.GLX_VERSION));
}
+
+ if (staticDisplay != 0) {
+ String vendor = GLX.glXGetClientString(staticDisplay, GLX.GLX_VENDOR);
+ if (vendor != null && vendor.startsWith("ATI")) {
+ isVendorATI = true;
+ }
+ }
} finally {
getX11Factory().unlockToolkit();
}
@@ -493,6 +505,12 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
return (X11GLDrawableFactory) getFactory();
}
+ /** Workaround for apparent issue with ATI's proprietary drivers
+ where direct contexts still send GLX tokens for GL calls */
+ public static boolean isVendorATI() {
+ return isVendorATI;
+ }
+
private void maybeDoSingleThreadedWorkaround(Runnable action) {
if (Threading.isSingleThreaded() &&
!Threading.isOpenGLThread()) {