From ff4e2b1996d2cfab1eb154020106004fb71471fd Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 9 Apr 2014 08:38:09 +0200 Subject: Fix ShaderCode.insertShaderSource(..): Return 'position' if nothing has been added; ShaderCode.addDefaultShaderPrecision(..): Branch GLES3 before GLES2, since gles2.isGLES2() == true --- .../classes/com/jogamp/opengl/util/glsl/ShaderCode.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/com/jogamp/opengl') 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; -- cgit v1.2.3