aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun')
-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()) {