aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-04-09 08:38:09 +0200
committerSven Gothel <[email protected]>2014-04-09 08:38:09 +0200
commitff4e2b1996d2cfab1eb154020106004fb71471fd (patch)
tree8568070f05c64b9da92e13c8115aa8d8caa0658f /src/jogl/classes/com/jogamp/opengl/util
parent9bcf943a1c149fd2a196a321260a32b51814a0b0 (diff)
Fix ShaderCode.insertShaderSource(..): Return 'position' if nothing has been added; ShaderCode.addDefaultShaderPrecision(..): Branch GLES3 before GLES2, since gles2.isGLES2() == true
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java14
1 files changed, 7 insertions, 7 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 812cbcc9d..7c6a40468 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -726,7 +726,7 @@ public class ShaderCode {
return position+data.length();
}
}
- return -1;
+ return position;
}
/**
@@ -931,22 +931,22 @@ public class ShaderCode {
*/
public final int addDefaultShaderPrecision(GL2ES2 gl, int pos) {
final String defaultPrecision;
- if( gl.isGLES2() ) {
+ if( gl.isGLES3() ) {
switch ( shaderType ) {
case GL2ES2.GL_VERTEX_SHADER:
- defaultPrecision = es2_default_precision_vp; break;
+ defaultPrecision = es3_default_precision_vp; break;
case GL2ES2.GL_FRAGMENT_SHADER:
- defaultPrecision = es2_default_precision_fp; break;
+ defaultPrecision = es3_default_precision_fp; break;
default:
defaultPrecision = null;
break;
}
- } else if( gl.isGLES3() ) {
+ } else if( gl.isGLES2() ) {
switch ( shaderType ) {
case GL2ES2.GL_VERTEX_SHADER:
- defaultPrecision = es3_default_precision_vp; break;
+ defaultPrecision = es2_default_precision_vp; break;
case GL2ES2.GL_FRAGMENT_SHADER:
- defaultPrecision = es3_default_precision_fp; break;
+ defaultPrecision = es2_default_precision_fp; break;
default:
defaultPrecision = null;
break;