summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-12-21 14:40:36 +0100
committerSven Gothel <[email protected]>2013-12-21 14:40:36 +0100
commit972feb4be95d1c16c71b84694729952e91dda668 (patch)
tree6c73b547fc8e9dbd9e0855520cee221e05d7da95 /src/jogl/classes/com/jogamp
parentbbb7f94c015fbfefdff672eb2d261fbd230c4e81 (diff)
Bug 925 - Accept an ES3 Context, if reported via GL-Version-String w/o EGL_OPENGL_ES3_BIT_KHR
Add Quirk 'GLES3ViaEGLES2Config': ES3 Context is used via EGL_OPENGL_ES2_BIT and 'version 2' for create context attributes. - GLContextImpl.setGLFunctionAvailability(..)'s ES version validation only fails if requested major version == 1 and doesn't match. Hence requesting major==2 and having version 3 is tolerated. - GLContextImpl.setGLFunctionAvailability(..)'s Quirks: requested-major < has-major -> Adding GLES3ViaEGLES2Config - EGLDrawableFactory.mapAvailableEGLESConfig(..): Reflects has-major version, i.e. GLES3ViaEGLES2Config situation where an ES2 request leads to an ES3 version. Note: All workarounds can be found via lookup of GLES3ViaEGLES2Config (as usual when using quirks).
Diffstat (limited to 'src/jogl/classes/com/jogamp')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index 95f87be29..daa0d94dd 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -31,6 +31,9 @@ import java.util.IdentityHashMap;
import javax.media.nativewindow.AbstractGraphicsDevice;
+import jogamp.opengl.egl.EGL;
+import jogamp.opengl.egl.EGLExt;
+
/**
* GLRendererQuirks contains information of known bugs of various GL renderer.
* This information allows us to workaround them.
@@ -235,15 +238,33 @@ public class GLRendererQuirks {
*/
public static final int GLSharedContextBuggy = 14;
+ /**
+ * Bug 925 - Accept an ES3 Context, if reported via GL-Version-String w/o {@link EGLExt#EGL_OPENGL_ES3_BIT_KHR}.
+ * <p>
+ * The ES3 Context can be used via {@link EGL#EGL_OPENGL_ES2_BIT}.
+ * </p>
+ * <p>
+ * The ES3 Context {@link EGL#eglCreateContext(long, long, long, java.nio.IntBuffer) must be created} with version attributes:
+ * <pre>
+ * EGL.EGL_CONTEXT_CLIENT_VERSION, 2, ..
+ * </pre>
+ * </p>
+ * <ul>
+ * <li>Mesa/AMD >= 9.2.1</li>
+ * <li>Some Android ES3 drivers ..</li>
+ * </ul>
+ */
+ public static final int GLES3ViaEGLES2Config = 15;
+
/** Number of quirks known. */
- public static final int COUNT = 15;
+ public static final int COUNT = 16;
private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval",
"NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard",
"GLNonCompliant", "GLFlushBeforeRelease", "DontCloseX11Display",
"NeedCurrCtx4ARBPixFmtQueries", "NeedCurrCtx4ARBCreateContext",
"NoFullFBOSupport", "GLSLNonCompliant", "GL4NeedsGL3Request",
- "GLSharedContextBuggy"
+ "GLSharedContextBuggy", "GLES3ViaEGLES2Config"
};
private static final IdentityHashMap<String, GLRendererQuirks> stickyDeviceQuirks = new IdentityHashMap<String, GLRendererQuirks>();
@@ -278,6 +299,16 @@ public class GLRendererQuirks {
sq.addQuirks(quirks, offset, len);
}
/**
+ * {@link #addQuirks(GLRendererQuirks) Adding given quirks} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}.
+ * <p>
+ * Not thread safe.
+ * </p>
+ */
+ public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks quirks) throws IllegalArgumentException {
+ final GLRendererQuirks sq = getStickyDeviceQuirks(device);
+ sq.addQuirks(quirks);
+ }
+ /**
* {@link #exist(int) Query} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}.
* <p>
* Not thread safe. However, use after changing the sticky quirks is safe.