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
3.0
rem..om 13 years ago
parent 5bc0b40b7f
commit c011a29529
  1. 17
      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); GLES20.glGetShaderiv(id, GLES20.GL_INFO_LOG_LENGTH, intBuf1);
checkGLError(); checkGLError();
int length = intBuf1.get(0);
if (length > 3) {
// get infos
ByteBuffer logBuf = BufferUtils.createByteBuffer(length);
if (verboseLogging) { if (verboseLogging) {
logger.info("GLES20.glGetShaderInfoLog(" + id + ")"); logger.info("GLES20.glGetShaderInfoLog(" + id + ")");
} }
infoLog = GLES20.glGetShaderInfoLog(id); infoLog = GLES20.glGetShaderInfoLog(id);
} logger.severe("Errooooooooooot(" + id + ")");
} }
if (compiledOK) { if (compiledOK) {
@ -1076,12 +1072,13 @@ public class OGLESShaderRenderer implements Renderer {
logger.log(Level.FINE, "compile success: " + source.getName()); logger.log(Level.FINE, "compile success: " + source.getName());
} }
} else { } else {
logger.log(Level.WARNING, "Bad compile of:\n{0}{1}",
new Object[]{source.getDefines(), source.getSource()});
if (infoLog != null) { if (infoLog != null) {
logger.log(Level.WARNING, "compile error: " + source.getName() + ", " + infoLog); throw new RendererException("compile error in:" + source + " error:" + infoLog);
} else { } else {
logger.log(Level.WARNING, "compile error: " + source.getName()); throw new RendererException("compile error in:" + source + " error: <not provided>");
} }
logger.log(Level.WARNING, source.getDefines() + "\n" + source.getSource());
} }
source.clearUpdateNeeded(); source.clearUpdateNeeded();
@ -1184,9 +1181,9 @@ public class OGLESShaderRenderer implements Renderer {
} }
} else { } else {
if (infoLog != null) { if (infoLog != null) {
logger.log(Level.WARNING, "shader link failure. \n{0}", infoLog); throw new RendererException("Shader link failure, shader:" + shader + " info:" + infoLog);
} else { } else {
logger.warning("shader link failure"); throw new RendererException("Shader link failure, shader:" + shader + " info: <not provided>");
} }
} }

Loading…
Cancel
Save