aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/GLProfile.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-07 08:36:46 +0100
committerSven Gothel <[email protected]>2013-11-07 08:36:46 +0100
commit2dce639c479f820d1a1e701f5eddffc4b02f5e0f (patch)
tree272c5912c8ad6577f6c6d24b469fff1299efb5d0 /src/jogl/classes/javax/media/opengl/GLProfile.java
parent0a06ca59520c611a3d67fe0f0ddbdcfef7ae3870 (diff)
Bug 890 - Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings; Validate isGLES*() usage and definition ; Add and use ShaderCode.createExtensionDirective(..)
- Fix GLES3 Profile Mapping, i.e. GL2ES2 queries and mappings - GLProfile: Add GL2ES2 -> ES3 mapping - EGLContext: Reuqest major '3' for ES3 - EGLGLCapabilities/EGLGraphicsConfiguration: Consider EGLExt.EGL_OPENGL_ES3_BIT_KHR - Validate isGLES*() usage and definition - Fix BuildComposablePipeline's isGLES() code - For GLSL related queries use isGLES() instead of isGLES2(), which would exclude ES3 - Add and use ShaderCode.createExtensionDirective(..) - Supporting creating GLSL extension directives while reusing strings from GLExtensions - Minor cleanup of GLContextImpl.setGLFuncAvail(..)
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/GLProfile.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index c04971176..64c8a6243 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -278,7 +278,7 @@ public class GLProfile {
if(useIndent) {
doIndent(sb, indent, indentCount).append("Natives");
indentCount++;
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4bc).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4bc+" ").append(indent);
} else {
sb.append("Natives["+GL4bc+" ");
}
@@ -291,7 +291,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4+" ").append(indent);
} else {
sb.append(", "+GL4+" ");
}
@@ -304,7 +304,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES3).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES3+" ").append(indent);
} else {
sb.append(", "+GLES3+" ");
}
@@ -317,7 +317,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3bc).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3bc+" ").append(indent);
} else {
sb.append(", "+GL3bc+" ");
}
@@ -330,7 +330,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL3+" ").append(indent);
} else {
sb.append(", "+GL3+" ");
}
@@ -343,7 +343,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2+" ").append(indent);
} else {
sb.append(", "+GL2+" ");
}
@@ -356,7 +356,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES2).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES2+" ").append(indent);
} else {
sb.append(", "+GLES2+" ");
}
@@ -369,7 +369,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES1).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GLES1+" ").append(indent);
} else {
sb.append(", "+GLES1+" ");
}
@@ -391,7 +391,7 @@ public class GLProfile {
}
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4ES3).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL4ES3+" ").append(indent);
} else {
sb.append(", "+GL4ES3+" ");
}
@@ -399,7 +399,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2GL3).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2GL3+" ").append(indent);
} else {
sb.append(", "+GL2GL3+" ");
}
@@ -407,7 +407,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES2).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES2+" ").append(indent);
} else {
sb.append(", "+GL2ES2+" ");
}
@@ -415,7 +415,7 @@ public class GLProfile {
allCount++;
if(useIndent) {
- doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES1).append(indent);
+ doIndent(sb.append(Platform.getNewline()), indent, indentCount).append(GL2ES1+" ").append(indent);
} else {
sb.append(", "+GL2ES1+" ");
}
@@ -438,7 +438,7 @@ public class GLProfile {
if(useIndent) {
doIndent(sb.append(Platform.getNewline()), indent, indentCount);
}
- sb.append(entry.getKey()+(useIndent?"\t":" ")+entry.getValue());
+ sb.append(entry.getKey()+(useIndent?" \t":" ")+entry.getValue());
if(!useIndent) {
sb.append(", ");
}
@@ -1208,17 +1208,17 @@ public class GLProfile {
/** Indicates whether this profile uses the native OpenGL ES2 implementations. */
public final boolean usesNativeGLES2() {
- return GLES3 == getImplName() || GLES2 == getImplName();
+ return GLES2 == getImplName();
}
- /** Indicates whether this profile uses the native OpenGL ES2 implementations. */
+ /** Indicates whether this profile uses the native OpenGL ES3 implementations. */
public final boolean usesNativeGLES3() {
return GLES3 == getImplName();
}
/** Indicates whether this profile uses either of the native OpenGL ES implementations. */
public final boolean usesNativeGLES() {
- return usesNativeGLES2() || usesNativeGLES1();
+ return usesNativeGLES3() || usesNativeGLES2() || usesNativeGLES1();
}
/**
@@ -1945,33 +1945,40 @@ public class GLProfile {
final boolean es2HardwareRasterizer[] = new boolean[1];
final boolean gles2Available = hasGLES3Impl && ( esCtxUndef || GLContext.isGLES2Available(device, es2HardwareRasterizer) );
final boolean gles2HWAvailable = gles2Available && es2HardwareRasterizer[0] ;
+ final boolean es3HardwareRasterizer[] = new boolean[1];
+ final boolean gles3Available = hasGLES3Impl && ( esCtxUndef || GLContext.isGLES3Available(device, es3HardwareRasterizer) );
+ final boolean gles3HWAvailable = gles3Available && es3HardwareRasterizer[0] ;
if(hasGL234Impl) {
if(GLContext.isGL4Available(device, isHardwareRasterizer)) {
- if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+ if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
return GL4;
}
}
if(GLContext.isGL4bcAvailable(device, isHardwareRasterizer)) {
- if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+ if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
return GL4bc;
}
}
if(GLContext.isGL3Available(device, isHardwareRasterizer)) {
- if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+ if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
return GL3;
}
}
if(GLContext.isGL3bcAvailable(device, isHardwareRasterizer)) {
- if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+ if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
return GL3bc;
}
}
if(desktopCtxUndef || GLContext.isGL2Available(device, isHardwareRasterizer)) {
- if(!gles2HWAvailable || isHardwareRasterizer[0]) {
+ if( (!gles3HWAvailable && !gles2HWAvailable ) || isHardwareRasterizer[0] ) {
return GL2;
}
}
}
+ if(gles3Available && ( !gles2HWAvailable || gles3HWAvailable ) ) {
+ isHardwareRasterizer[0] = es3HardwareRasterizer[0];
+ return GLES3;
+ }
if(gles2Available) {
isHardwareRasterizer[0] = es2HardwareRasterizer[0];
return GLES2;