aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java2
-rw-r--r--src/jogl/classes/jogamp/opengl/GLContextImpl.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java61
3 files changed, 59 insertions, 16 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 1f9460f5d..a43ddee07 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -510,7 +510,7 @@ public class GLProfile {
/** The intersection of the desktop GL3 and GL2 profile */
public static final String GL2GL3 = "GL2GL3";
- /** The intersection of the desktop GL4 and ES3 profile */
+ /** The intersection of the desktop GL4 and ES3 profile, available only if either ES3 or GL4 w/ <code>GL_ARB_ES3_compatibility</code> is available. */
public static final String GL4ES3 = "GL4ES3";
/** The default profile, used for the device default profile map */
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 808d837ce..8f1ba4585 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -1462,8 +1462,10 @@ public abstract class GLContextImpl extends GLContext {
if( strictMatch &&
( ( ( isES || major >= 3 ) && hasGLVersionByInt.compareTo(reqGLVersion) < 0 ) ||
( isES &&
- ( 2 == major && ( 2 > hasMajor || hasMajor > 3 ) ) || // 2 -> [2..3]
- ( ( 1 == major || 3 <= major ) && major != hasMajor ) // 1,3,.. -> equal
+ (
+ ( 2 == major && ( 2 > hasMajor || hasMajor > 3 ) ) || // 2 -> [2..3]
+ ( ( 1 == major || 3 <= major ) && major != hasMajor ) // 1,3,.. -> equal
+ )
)
) ) {
if(DEBUG) {
@@ -1503,8 +1505,10 @@ public abstract class GLContextImpl extends GLContext {
if( strictMatch &&
( ( ( isES || major >= 3 ) && hasGLVersionByString.compareTo(reqGLVersion) < 0 ) ||
( isES &&
- ( 2 == major && ( 2 > hasMajor || hasMajor > 3 ) ) || // 2 -> [2..3]
- ( ( 1 == major || 3 <= major ) && major != hasMajor ) // 1,3,.. -> equal
+ (
+ ( 2 == major && ( 2 > hasMajor || hasMajor > 3 ) ) || // 2 -> [2..3]
+ ( ( 1 == major || 3 <= major ) && major != hasMajor ) // 1,3,.. -> equal
+ )
)
) ) {
if(DEBUG) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
index 76dc9e9fd..88d643aa6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
@@ -73,13 +73,18 @@ public class TestGLProfile01NEWT extends UITestCase {
}
static void validate(GLProfile glp) {
+ final boolean gles3CompatAvail = GLContext.isGLES3CompatibleAvailable(GLProfile.getDefaultDevice());
if( glp.getImplName().equals(GLProfile.GL4bc) ) {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4bc));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3bc));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2GL3));
- Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ } else {
+ Assert.assertFalse(GLProfile.isAvailable(GLProfile.GL4ES3));
+ }
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES1));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2));
} else if(glp.getImplName().equals(GLProfile.GL3bc)) {
@@ -98,7 +103,11 @@ public class TestGLProfile01NEWT extends UITestCase {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3));
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2GL3));
- Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ } else {
+ Assert.assertFalse(GLProfile.isAvailable(GLProfile.GL4ES3));
+ }
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2));
} else if(glp.getImplName().equals(GLProfile.GL3)) {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3));
@@ -106,7 +115,11 @@ public class TestGLProfile01NEWT extends UITestCase {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2));
} else if(glp.getImplName().equals(GLProfile.GLES3)) {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GLES3));
- Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4ES3));
+ } else {
+ Assert.assertFalse(GLProfile.isAvailable(GLProfile.GL4ES3));
+ }
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2ES2));
} else if(glp.getImplName().equals(GLProfile.GLES2)) {
Assert.assertTrue(GLProfile.isAvailable(GLProfile.GLES2));
@@ -157,13 +170,20 @@ public class TestGLProfile01NEWT extends UITestCase {
}
static void validate(GL gl) {
+ final GLContext ctx = gl.getContext();
+ final boolean gles3CompatAvail = ctx.isGLES3Compatible();
+
if( gl.isGL4bc() ) {
Assert.assertTrue(gl.isGL4());
Assert.assertTrue(gl.isGL3bc());
Assert.assertTrue(gl.isGL3());
Assert.assertTrue(gl.isGL2());
Assert.assertTrue(gl.isGL2GL3());
- Assert.assertTrue(gl.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(gl.isGL4ES3());
+ } else {
+ Assert.assertFalse(gl.isGL4ES3());
+ }
Assert.assertTrue(gl.isGL3ES3());
Assert.assertTrue(gl.isGL2ES1());
Assert.assertTrue(gl.isGL2ES2());
@@ -180,7 +200,11 @@ public class TestGLProfile01NEWT extends UITestCase {
} else if(gl.isGL4()) {
Assert.assertTrue(gl.isGL3());
Assert.assertTrue(gl.isGL2GL3());
- Assert.assertTrue(gl.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(gl.isGL4ES3());
+ } else {
+ Assert.assertFalse(gl.isGL4ES3());
+ }
Assert.assertTrue(gl.isGL3ES3());
Assert.assertTrue(gl.isGL2ES2());
} else if(gl.isGL3()) {
@@ -188,7 +212,11 @@ public class TestGLProfile01NEWT extends UITestCase {
Assert.assertTrue(gl.isGL3ES3());
Assert.assertTrue(gl.isGL2ES2());
} else if(gl.isGLES3()) {
- Assert.assertTrue(gl.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(gl.isGL4ES3());
+ } else {
+ Assert.assertFalse(gl.isGL4ES3());
+ }
Assert.assertTrue(gl.isGL3ES3());
Assert.assertTrue(gl.isGL2ES2());
} else if(gl.isGLES2()) {
@@ -197,14 +225,17 @@ public class TestGLProfile01NEWT extends UITestCase {
Assert.assertTrue(gl.isGL2ES1());
}
- final GLContext ctx = gl.getContext();
if( ctx.isGL4bc() ) {
Assert.assertTrue(ctx.isGL4());
Assert.assertTrue(ctx.isGL3bc());
Assert.assertTrue(ctx.isGL3());
Assert.assertTrue(ctx.isGL2());
Assert.assertTrue(ctx.isGL2GL3());
- Assert.assertTrue(ctx.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(ctx.isGL4ES3());
+ } else {
+ Assert.assertFalse(ctx.isGL4ES3());
+ }
Assert.assertTrue(ctx.isGL3ES3());
Assert.assertTrue(ctx.isGL2ES1());
Assert.assertTrue(ctx.isGL2ES2());
@@ -221,7 +252,11 @@ public class TestGLProfile01NEWT extends UITestCase {
} else if(ctx.isGL4()) {
Assert.assertTrue(ctx.isGL3());
Assert.assertTrue(ctx.isGL2GL3());
- Assert.assertTrue(ctx.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(ctx.isGL4ES3());
+ } else {
+ Assert.assertFalse(ctx.isGL4ES3());
+ }
Assert.assertTrue(ctx.isGL3ES3());
Assert.assertTrue(ctx.isGL2ES2());
} else if(ctx.isGL3()) {
@@ -229,7 +264,11 @@ public class TestGLProfile01NEWT extends UITestCase {
Assert.assertTrue(ctx.isGL3ES3());
Assert.assertTrue(ctx.isGL2ES2());
} else if(ctx.isGLES3()) {
- Assert.assertTrue(ctx.isGL4ES3());
+ if( gles3CompatAvail ) {
+ Assert.assertTrue(ctx.isGL4ES3());
+ } else {
+ Assert.assertFalse(ctx.isGL4ES3());
+ }
Assert.assertTrue(ctx.isGL3ES3());
Assert.assertTrue(ctx.isGL2ES2());
} else if(ctx.isGLES2()) {
@@ -363,7 +402,7 @@ public class TestGLProfile01NEWT extends UITestCase {
public void init(GLAutoDrawable drawable) {
final GL gl = drawable.getGL();
- System.err.println(JoglVersion.getGLStrings(gl, null, false));
+ System.err.println(JoglVersion.getGLStrings(gl, null, true));
validate(gl);