diff options
author | Sven Gothel <[email protected]> | 2019-09-07 01:08:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-09-07 01:08:05 +0200 |
commit | 35f719673b2c55b0766e6c9187961db7153d7d26 (patch) | |
tree | 3e9d85426a2e1f279a47d8f0c1e9c953e7142c2c /src | |
parent | 90760ac8eebe7431ac7392e4ebf3f9009e63cd72 (diff) |
Bug 1391: Cleanup to submit fix: Update known Quirk range; BuggyColorRenderbuffer enables NoFullFBOSupport
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/GLDrawableFactory.java | 3 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java | 21 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 12 |
3 files changed, 25 insertions, 11 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLDrawableFactory.java b/src/jogl/classes/com/jogamp/opengl/GLDrawableFactory.java index 1fe42a332..113c28775 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/GLDrawableFactory.java @@ -404,8 +404,7 @@ public abstract class GLDrawableFactory { * @see GLRendererQuirks */ public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final GLProfile glp, final int quirk) { - final GLRendererQuirks glrq = getRendererQuirks(device, glp); - return null != glrq ? glrq.exist(quirk) : false; + return GLRendererQuirks.exist(getRendererQuirks(device, glp), quirk); } /** diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index a2dc6832e..6f0aa2186 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -1,5 +1,5 @@ /** - * Copyright 2012 JogAmp Community. All rights reserved. + * Copyright 2012 - 2019 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -88,7 +88,7 @@ public class GLRendererQuirks { } /** - * Crashes XServer when using double buffered PBuffer with GL_RENDERER: + * Crashes XServer when using double buffered PBuffer with hardware GL_RENDERER on Mesa < 18.2.2: * <ul> * <li>Mesa DRI Intel(R) Sandybridge Desktop</li> * <li>Mesa DRI Intel(R) Ivybridge Mobile - 3.0 Mesa 8.0.4</li> @@ -107,7 +107,7 @@ public class GLRendererQuirks { /** No offscreen bitmap available, currently true for JOGL's OSX implementation. */ public static final int NoOffscreenBitmap = 3; - /** SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) */ + /** SIGSEGV on setSwapInterval() after changing the context's drawable w/ Mesa >= 8.0.4 until Mesa < 18.2.2: dri2SetSwapInterval/DRI2 (soft & intel) */ public static final int NoSetSwapIntervalPostRetarget = 4; /** @@ -232,7 +232,7 @@ public class GLRendererQuirks { * </ul></li> * </ul> * <p> - * Also enabled via {@link #BuggyColorRenderbuffer}. + * Note: Also enabled via {@link #BuggyColorRenderbuffer}. * </p> */ public static final int NoFullFBOSupport = 11; @@ -674,6 +674,19 @@ public class GLRendererQuirks { return 0 != ( ( 1 << quirkBit ) & ( ~_bitmaskOverrideIgnore & ( _bitmask | _bitmaskOverrideForce ) ) ); } + /** + * Convenient static method to call {@link #exist(int)} on the given {@code quirks} + * with an added {@code null} check. + * @param quirks {@link GLRendererQuirks} instance, maybe {@code null} + * @param quirkBit the quirk to be tested + * @return {@code true} if the {@code quirks} is not {@code null} and the given {@code quirkBit} is set, otherwise {@code false}. + * @throws IllegalArgumentException if quirk is out of range + * @see #exist(int) + */ + public static boolean exist(final GLRendererQuirks quirks, final int quirkBit) throws IllegalArgumentException { + return null != quirks && quirks.exist(quirkBit); + } + public final StringBuilder toString(StringBuilder sb) { if(null == sb) { sb = new StringBuilder(); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index aba9054d0..443e2d6af 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -2451,25 +2451,27 @@ public abstract class GLContextImpl extends GLContext { if( vendorVersion.compareTo(mesaSafeDoubleBufferedPBuffer) < 0 ) { final int quirk = GLRendererQuirks.NoDoubleBufferedPBuffer; if(DEBUG) { - System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Renderer " + glRenderer); + System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Renderer " + glRenderer + " / Mesa-Version "+vendorVersion); } quirks.addQuirk( quirk ); } } else { // software if( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // FIXME: Is it fixed in >= 8.0.0 ? - final int quirk = GLRendererQuirks.BuggyColorRenderbuffer; + final int quirk1 = GLRendererQuirks.BuggyColorRenderbuffer; + final int quirk2 = GLRendererQuirks.NoFullFBOSupport; if(DEBUG) { - System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Renderer " + glRenderer + " / Mesa-Version "+vendorVersion); + System.err.println("Quirks: "+GLRendererQuirks.toString(quirk1)+", "+GLRendererQuirks.toString(quirk2)+": cause: Renderer " + glRenderer + " / Mesa-Version "+vendorVersion); } - quirks.addQuirk( quirk ); + quirks.addQuirk( quirk1 ); + quirks.addQuirk( quirk2 ); } } if ( compatCtx && (hasMajor > 3 || (hasMajor == 3 && hasMinor >= 1)) && vendorVersion.compareTo(mesaSafeGL3Compat) < 0 ) { final int quirk = GLRendererQuirks.GL3CompatNonCompliant; if(DEBUG) { - System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Renderer " + glRenderer); + System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: Renderer " + glRenderer + " / Mesa-Version "+vendorVersion); } quirks.addQuirk( quirk ); } |