From c011a2952999678ae8ada91b81369e0f0e866c72 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sun, 18 Sep 2011 14:21:07 +0000 Subject: [PATCH] OGLES renderer : gl error now appear after the shader code output when a shader fail to compile (like in LWJGL renderer) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8264 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../renderer/android/OGLESShaderRenderer.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java index c02f1de7a..44fd56d2b 100644 --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java @@ -1058,15 +1058,11 @@ public class OGLESShaderRenderer implements Renderer { } GLES20.glGetShaderiv(id, GLES20.GL_INFO_LOG_LENGTH, intBuf1); checkGLError(); - int length = intBuf1.get(0); - if (length > 3) { - // get infos - ByteBuffer logBuf = BufferUtils.createByteBuffer(length); - if (verboseLogging) { - logger.info("GLES20.glGetShaderInfoLog(" + id + ")"); - } - infoLog = GLES20.glGetShaderInfoLog(id); + if (verboseLogging) { + logger.info("GLES20.glGetShaderInfoLog(" + id + ")"); } + infoLog = GLES20.glGetShaderInfoLog(id); + logger.severe("Errooooooooooot(" + id + ")"); } if (compiledOK) { @@ -1076,12 +1072,13 @@ public class OGLESShaderRenderer implements Renderer { logger.log(Level.FINE, "compile success: " + source.getName()); } } else { + logger.log(Level.WARNING, "Bad compile of:\n{0}{1}", + new Object[]{source.getDefines(), source.getSource()}); if (infoLog != null) { - logger.log(Level.WARNING, "compile error: " + source.getName() + ", " + infoLog); + throw new RendererException("compile error in:" + source + " error:" + infoLog); } else { - logger.log(Level.WARNING, "compile error: " + source.getName()); + throw new RendererException("compile error in:" + source + " error: "); } - logger.log(Level.WARNING, source.getDefines() + "\n" + source.getSource()); } source.clearUpdateNeeded(); @@ -1184,9 +1181,9 @@ public class OGLESShaderRenderer implements Renderer { } } else { if (infoLog != null) { - logger.log(Level.WARNING, "shader link failure. \n{0}", infoLog); + throw new RendererException("Shader link failure, shader:" + shader + " info:" + infoLog); } else { - logger.warning("shader link failure"); + throw new RendererException("Shader link failure, shader:" + shader + " info: "); } }