summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLProfile.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-12-07 04:03:02 +0100
committerSven Gothel <[email protected]>2014-12-07 04:03:02 +0100
commit35622a7cef4a28ce7e32bf008ef331d9a0d9e3e2 (patch)
treee688b4fcb141c0b6b026d20379fb0ba6dd60a256 /src/jogl/classes/javax/media/opengl/GLProfile.java
parent9ea218a5990b908e04235c407c0951c60df6ffba (diff)
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
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java47
1 files changed, 37 insertions, 10 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index c1ca9a48b..7f29bb7dc 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -53,6 +53,7 @@ import com.jogamp.common.util.locks.LockFactory;
import com.jogamp.common.util.locks.RecursiveThreadGroupLock;
import com.jogamp.gluegen.runtime.FunctionAddressResolver;
import com.jogamp.nativewindow.NativeWindowVersion;
+import com.jogamp.opengl.GLRendererQuirks;
import com.jogamp.opengl.JoglVersion;
import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -80,13 +81,6 @@ public class GLProfile {
public static final boolean DEBUG;
/**
- * In case no OpenGL ES profiles are required
- * and if one platform may have a buggy implementation,
- * setting the property <code>jogl.disable.opengles</code> disables querying possible existing OpenGL ES profiles.
- */
- public static final boolean disableOpenGLES;
-
- /**
* In case no native OpenGL core profiles are required
* and if one platform may have a buggy implementation,
* setting the property <code>jogl.disable.openglcore</code> disables querying possible existing native OpenGL core profiles.
@@ -101,12 +95,43 @@ public class GLProfile {
* context creation extension is buggy on one platform,
* setting the property <code>jogl.disable.openglarbcontext</code> disables utilizing it.
* <p>
+ * This exclusion also disables {@link #disableOpenGLES OpenGL ES}.
+ * </p>
+ * <p>
* This exclusion is disabled for {@link Platform.OSType#MACOS}.
* </p>
*/
public static final boolean disableOpenGLARBContext;
/**
+ * In case no OpenGL ES profiles are required
+ * and if one platform may have a buggy implementation,
+ * setting the property <code>jogl.disable.opengles</code> disables querying possible existing OpenGL ES profiles.
+ */
+ public static final boolean disableOpenGLES;
+
+ /**
+ * In case no OpenGL desktop profiles are required
+ * and if one platform may have a buggy implementation,
+ * setting the property <code>jogl.disable.opengldesktop</code> disables querying possible existing OpenGL desktop profiles.
+ */
+ public static final boolean disableOpenGLDesktop;
+
+ /**
+ * Disable surfaceless OpenGL context capability and its probing
+ * by setting the property <code>jogl.disable.surfacelesscontext</code>.
+ * <p>
+ * By default surfaceless OpenGL context capability is probed,
+ * i.e. whether an OpenGL context can be made current without a default framebuffer.
+ * </p>
+ * <p>
+ * If probing fails or if this property is set, the {@link GLRendererQuirks quirk} {@link GLRendererQuirks#NoSurfacelessCtx}
+ * is being set.
+ * </p>
+ */
+ public static final boolean disableSurfacelessContext;
+
+ /**
* We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
* When run in the mentioned browsers, the eglInitialize(..) implementation crashes.
* <p>
@@ -122,9 +147,11 @@ public class GLProfile {
final boolean isOSX = Platform.OSType.MACOS == Platform.getOSType();
DEBUG = Debug.debug("GLProfile");
- disableOpenGLES = PropertyAccess.isPropertyDefined("jogl.disable.opengles", true);
disableOpenGLCore = PropertyAccess.isPropertyDefined("jogl.disable.openglcore", true) && !isOSX;
disableOpenGLARBContext = PropertyAccess.isPropertyDefined("jogl.disable.openglarbcontext", true) && !isOSX;
+ disableOpenGLES = disableOpenGLARBContext || PropertyAccess.isPropertyDefined("jogl.disable.opengles", true);
+ disableOpenGLDesktop = PropertyAccess.isPropertyDefined("jogl.disable.opengldesktop", true);
+ disableSurfacelessContext = PropertyAccess.isPropertyDefined("jogl.disable.surfacelesscontext", true);
enableANGLE = PropertyAccess.isPropertyDefined("jogl.enable.ANGLE", true);
}
@@ -1895,7 +1922,7 @@ public class GLProfile {
// also test GLES1, GLES2 and GLES3 on desktop, since we have implementations / emulations available.
if( deviceIsEGLCompatible && ( hasGLES3Impl || hasGLES1Impl ) ) {
// 1st pretend we have all EGL profiles ..
- computeProfileMap(device, false /* desktopCtxUndef*/, true /* esCtxUndef */);
+ computeProfileMap(device, true /* desktopCtxUndef*/, true /* esCtxUndef */);
// Triggers eager initialization of share context in GLDrawableFactory for the device,
// hence querying all available GLProfiles
@@ -1935,7 +1962,7 @@ public class GLProfile {
}
if(!GLContext.getAvailableGLVersionsSet(device)) {
- GLContext.setAvailableGLVersionsSet(device);
+ GLContext.setAvailableGLVersionsSet(device, true);
}
if (DEBUG) {