From 9b6448b1d54716fd455c0cad0c6133c0edeb3bb8 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 28 Oct 2012 22:56:21 +0100 Subject: GLRendererQuirks: Add RequiresBoundVAO (w/ impl.), GLSLBuggyDiscard (todo) ; GLContextImpl: Bind default VAO if having quirk RequiresBoundVAO. OSX w/ OpenGL >= 3 core context implementation requires a bound VAO for vertex attribute operations, i.e. VertexAttributePointer(..). This has been experienced on OSX 10.7.5, OpenGL 3.2 core w/ Nvidia GPU and in several forum posts. Such 'behavior' violates the GL 3.2 core specification, which does not state this requirement, hence it is a bug. (Please correct me if I am wrong!) GLContextImpl works around this quirk, by generating a default VAO and binds it at 1st makeCurrent (@creation) and deletes it at destroy. This is minimal invasive since no action is required for subsequent makeCurrent or release. We assume if a user uses and binds a VAO herself, she will mind this quirk. Note: We could enhance this workaround by quering for a currently bound VAO at makeCurrent() and bind our default if none. However, we refrain from this operation to minimize the workaround and complexity. --- src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index 82799bf67..51944cb71 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -58,12 +58,19 @@ public class GLRendererQuirks { /** SIGSEGV on setSwapInterval() after changing the context's drawable w/ 'Mesa 8.0.4' dri2SetSwapInterval/DRI2 (soft & intel) */ public static final int NoSetSwapIntervalPostRetarget = 4; + + /** Requires a bound VAO for vertex attribute operations, i.e. GL impl. uses no default VAO. Violates GL 3.2. On OSX OpenGL 3.2 context. FIXME: Constrain version. */ + public static final int RequiresBoundVAO = 5; + + /** GLSL discard command leads to undefined behavior or won't get compiled if being used. Appears to happen on Nvidia Tegra2. FIXME: Constrain version. */ + public static final int GLSLBuggyDiscard = 6; /** Number of quirks known. */ - public static final int COUNT = 5; + public static final int COUNT = 7; private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval", - "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget" + "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "RequiresBoundVAO", + "GLSLBuggyDiscard" }; private final int _bitmask; -- cgit v1.2.3