aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/GLExtensions.java1
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java28
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java1
3 files changed, 25 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
index c7aadcd14..da9e08a32 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
@@ -72,6 +72,7 @@ public class GLExtensions {
public static final String OES_read_format = "GL_OES_read_format";
public static final String OES_single_precision = "GL_OES_single_precision";
public static final String OES_EGL_image_external = "GL_OES_EGL_image_external";
+ public static final String OES_standard_derivatives = "GL_OES_standard_derivatives";
public static final String ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64";
public static final String ARB_shader_objects = "GL_ARB_shader_objects";
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";