diff options
author | Sven Gothel <[email protected]> | 2013-11-07 08:36:46 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-11-07 08:36:46 +0100 |
commit | 2dce639c479f820d1a1e701f5eddffc4b02f5e0f (patch) | |
tree | 272c5912c8ad6577f6c6d24b469fff1299efb5d0 /src/jogl/classes/com/jogamp/opengl/util | |
parent | 0a06ca59520c611a3d67fe0f0ddbdcfef7ae3870 (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/com/jogamp/opengl/util')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java | 28 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java | 1 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java index 206aa0fd7..6a64edeb5 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java @@ -843,8 +843,28 @@ public class ShaderCode { /** Default precision of GLSL ≥ 1.30 as required until < 1.50 for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #gl3_default_precision_fp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */ public static final String gl3_default_precision_fp = "\nprecision highp float;\nprecision mediump int;\n/*precision mediump sampler2D;*/\n"; - /** Prefer <code>enable</code> over <code>require</code>, since it won't force a failure. */ - public static final String extOESDerivativesEnable = "#extension GL_OES_standard_derivatives : enable\n"; + /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */ + public static final String REQUIRE = "require"; + /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */ + public static final String ENABLE = "enable"; + /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */ + public static final String DISABLE = "disable"; + /** <i>Behavior</i> for GLSL extension directive, see {@link #createExtensionDirective(String, String)}, value {@value}. */ + public static final String WARN = "warn"; + + /** + * Creates a GLSL extension directive. + * <p> + * Prefer {@link #ENABLE} over {@link #REQUIRE}, since the latter will force a failure if not supported. + * </p> + * + * @param extensionName + * @param behavior shall be either {@link #REQUIRE}, {@link #ENABLE}, {@link #DISABLE} or {@link #WARN} + * @return the complete extension directive + */ + public static String createExtensionDirective(String extensionName, String behavior) { + return "#extension " + extensionName + " : " + behavior; + } /** * Add GLSL version at the head of this shader source code. @@ -915,7 +935,7 @@ public class ShaderCode { /** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */ public static final boolean requiresDefaultPrecision(GL2ES2 gl) { - if( gl.isGLES2() || gl.isGLES3() ) { + if( gl.isGLES() ) { return true; } return requiresGL3DefaultPrecision(gl); @@ -979,7 +999,7 @@ public class ShaderCode { } else { pos = 0; } - if( gl.isGLES2() && null != esDefaultPrecision ) { + if( gl.isGLES() && null != esDefaultPrecision ) { pos = insertShaderSource(0, pos, esDefaultPrecision); } else { pos = addDefaultShaderPrecision(gl, pos); diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java index c34e019c2..6f1dd4c64 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java @@ -105,7 +105,6 @@ import com.jogamp.opengl.util.TimeFrameI; * */ public interface TextureSequence { - public static final String GL_OES_EGL_image_external_Required_Prelude = "#extension GL_OES_EGL_image_external : enable\n"; public static final String samplerExternalOES = "samplerExternalOES"; public static final String sampler2D = "sampler2D"; |