summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-12-23 23:09:23 +0100
committerSven Gothel <[email protected]>2013-12-23 23:09:23 +0100
commit3120d4ad150a24b370d7c64b3af3f0557097e979 (patch)
tree7bfc77de677c35f28d1e7d406fd31099997e76b9 /src
parentac705f0d6eea7c8ba27a7cf7c42674c7446576b4 (diff)
Bug 930 - OSX: Using 'Apple Software Renderer' GLRendererQuirks Quirk GL4NeedsGL3Request not set
GL3 core version validation failed due to missing braces around 'isES' _and_ term, where the latter consist out of 2 _or_ terms testing version mismatch. On OSX we validate a GL3 core context first and expect it to return a GL4 version if available, which in turn triggers the quirk GL4NeedsGL3Request. This behavior was disabled due to above mentioned bug, where the unqual major version caused the validation to fail. TestGLProfile01NEWT: Fixed 'GL4ES3' test, where 'GL4ES3' is only available if extension <code>GL_ARB_ES3_compatibility</code> is available as well.
Diffstat (limited to 'src')
-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);