From 972feb4be95d1c16c71b84694729952e91dda668 Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sat, 21 Dec 2013 14:40:36 +0100
Subject: 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).
---
.../com/jogamp/opengl/GLRendererQuirks.java | 35 ++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
(limited to 'src/jogl/classes/com/jogamp')
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}.
+ *
+ * The ES3 Context can be used via {@link EGL#EGL_OPENGL_ES2_BIT}.
+ *
+ *
+ * The ES3 Context {@link EGL#eglCreateContext(long, long, long, java.nio.IntBuffer) must be created} with version attributes:
+ *
+ * EGL.EGL_CONTEXT_CLIENT_VERSION, 2, ..
+ *
+ *
+ *
+ * - Mesa/AMD >= 9.2.1
+ * - Some Android ES3 drivers ..
+ *
+ */
+ 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 stickyDeviceQuirks = new IdentityHashMap();
@@ -277,6 +298,16 @@ public class GLRendererQuirks {
final GLRendererQuirks sq = getStickyDeviceQuirks(device);
sq.addQuirks(quirks, offset, len);
}
+ /**
+ * {@link #addQuirks(GLRendererQuirks) Adding given quirks} of sticky {@link AbstractGraphicsDevice}'s {@link GLRendererQuirks}.
+ *
+ * Not thread safe.
+ *
+ */
+ 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}.
*
--
cgit v1.2.3