From 523d1dae2431fdd56d39d3ea06220cfed412a0b5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 19 Mar 2014 22:35:52 +0100 Subject: GLRendererQuirks.NoMultiSamplingBuffers: Prelim detection of this quirk due to Gallium/Nouveau Driver (TODO: Handle it in GLCapabilities Selection) --- .../com/jogamp/opengl/GLRendererQuirks.java | 29 ++++++++++++++++++++-- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 15 ++++++++++- 2 files changed, 41 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index a643d81a9..cc709c96b 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -30,6 +30,8 @@ package com.jogamp.opengl; import java.util.IdentityHashMap; import javax.media.nativewindow.AbstractGraphicsDevice; +import javax.media.opengl.GLCapabilitiesImmutable; +import javax.media.opengl.GLDrawableFactory; import com.jogamp.common.os.Platform; @@ -289,15 +291,38 @@ public class GLRendererQuirks { */ public static final int SingletonEGLDisplayOnly = 16; + /** + * With certain drivers no reliable MSAA / FSAA + * {@link GLCapabilitiesImmutable#getSampleBuffers() multi} + * {@link GLCapabilitiesImmutable#getNumSamples() sampling} is available, read a crash may occur. + *

+ * Appears on: + *

+ * TODO: We have to determine the exact version range, i.e. not adding the quirk with fixed driver version! + *

+ * TODO: Since we currently don't handle this quirk internally, a user may need to do the following: + *
+     * final AbstractGraphicsDevice adevice = GLDrawableFactory.getDesktopFactory(); // or similar
+     * if( GLRendererQuirks.existStickyDeviceQuirk(adevice, GLRendererQuirks.NoMultiSamplingBuffers) ) {
+     *    // don't use MSAA
+     * }
+     * 
+ */ + public static final int NoMultiSamplingBuffers = 17; + /** Number of quirks known. */ - public static final int COUNT = 17; + public static final int COUNT = 18; private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval", "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard", "GLNonCompliant", "GLFlushBeforeRelease", "DontCloseX11Display", "NeedCurrCtx4ARBPixFmtQueries", "NeedCurrCtx4ARBCreateContext", "NoFullFBOSupport", "GLSLNonCompliant", "GL4NeedsGL3Request", - "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly" + "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly", + "NoMultiSamplingBuffers" }; private static final IdentityHashMap stickyDeviceQuirks = new IdentityHashMap(); diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 9ccd78589..04ecba262 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1869,13 +1869,26 @@ public abstract class GLContextImpl extends GLContext { quirks[i++] = quirk; } if( glRenderer.contains( MesaRendererIntelsp ) && - vendorVersion.compareTo(mesaIntelBuggySharedCtx921) >= 0 && isX11 ) { + vendorVersion.compareTo(mesaIntelBuggySharedCtx921) >= 0 && isX11 ) { // FIXME: When is it fixed ? final int quirk = GLRendererQuirks.GLSharedContextBuggy; if(DEBUG) { System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: X11 / Renderer " + glRenderer + " / Mesa-Version "+vendorVersion); } quirks[i++] = quirk; } + if( glVendor.contains( "nouveau" ) + // FIXME: && vendorVersion.compareTo(nouveauBuggyMSAAFixed) < 0 + ) { + final int quirk = GLRendererQuirks.NoMultiSamplingBuffers; + if(DEBUG) { + System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: X11 / Renderer " + glRenderer + " / Vendor "+glVendor); + } + quirks[i++] = quirk; + if( withinGLVersionsMapping ) { + // Thread safe due to single threaded initialization! + GLRendererQuirks.addStickyDeviceQuirks(adevice, quirks, i-1, 1); + } + } if( isWindows && glRenderer.contains("SVGA3D") ) { final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0); if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero() -- cgit v1.2.3