From d7b298938af58a4243badd9d90da2efa75c8923a Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 3 Apr 2006 21:16:16 +0000 Subject: 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 --- src/classes/com/sun/opengl/impl/x11/X11GLContext.java | 5 +++++ .../com/sun/opengl/impl/x11/X11GLDrawableFactory.java | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'src/classes/com/sun/opengl/impl') 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()) { -- cgit v1.2.3