From 35622a7cef4a28ce7e32bf008ef331d9a0d9e3e2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 7 Dec 2014 04:03:02 +0100 Subject: Bug 1068 - Allow GLContext creation and makeCurrent without default framebuffer (Part 2); Bug 896: EGL_KHR_create_context (Part 1) Bug 1068 - Allow GLContext creation and makeCurrent without default framebuffer (Part 2) Implement surfaceless context on EGL and GLX/X11 utilizing *UpstreamSurfacelessHook as introduced in commit 9ea218a5990b908e04235c407c0951c60df6ffba. Surfaceless context is probed during GL profile probing by default. If available, it will be used for offscreen FBO drawables. If probing fails, or is disabled, the new GLRendererQuirks.NoSurfacelessCtx is set. - GLProfile.disableSurfacelessContext disables surfaceless context probing, set property 'jogl.disable.surfacelesscontext' Tested: - Mesa/EGL works, - Mesa + NVidia w/ GLX fail on GNU/Linux): Fails NoSurfacelessCtx - TODO: Windows impl. and more tests +++ Bug 896: EGL_KHR_create_context (Part 1) - Detect EGL_KHR_create_context capability and utilize if available. - Implement EGLContext.createContextARBImpl(..), allowing native DEBUG context usage, where available. - EGL implements SharedResourceRunner, i.e. probing profiles on dedicated thread using common interface. - Probe desktop profile/context ability in EGLDrawableFactory SharedResourceRunner, Where EGLGLnDynamicLibraryBundleInfo covers EGL + desktop GL. - TODO: Tests w/ capable implementation --- .../com/jogamp/opengl/GLRendererQuirks.java | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl') diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java index 7b5e6b8f1..10b22b08d 100644 --- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java +++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java @@ -395,8 +395,36 @@ public class GLRendererQuirks { */ public static final int NeedSharedObjectSync = 20; + /** + * No support for ES or desktop GL >= 3.0 current context without surface, + * i.e. without a default framebuffer as read- and write drawables. + *

+ * See OpenGL spec 3.0, chapter 2.1 OpenGL Fundamentals, page 7 or
+ * OpenGL ES spec 3.0.2, chapter 2.1 OpenGL Fundamentals, page 6: + *

+     * It is possible to use a GL context without a default framebuffer, in which case
+     * a framebuffer object must be used to perform all rendering. This is useful for
+     * applications neeting to perform offscreen rendering.
+     * 
+ *

+ *

+ * The feature will be attempted at initialization and this quirk will be set if failing. + *

+ *

+ * Known drivers failing the specification: + *

+ *

+ */ + public static final int NoSurfacelessCtx = 21; + /** Return the number of known quirks. */ - public static final int getCount() { return 21; } + public static final int getCount() { return 22; } private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval", "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard", @@ -405,7 +433,7 @@ public class GLRendererQuirks { "NoFullFBOSupport", "GLSLNonCompliant", "GL4NeedsGL3Request", "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly", "NoMultiSamplingBuffers", "BuggyColorRenderbuffer", "NoPBufferWithAccum", - "NeedSharedObjectSync" + "NeedSharedObjectSync", "NoSurfacelessCtx" }; private static final IdentityHashMap stickyDeviceQuirks = new IdentityHashMap(); -- cgit v1.2.3