From 65c27304bec95aa00ada1a8edeee3046ba10c5f2 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sat, 11 Feb 2012 05:35:29 +0000 Subject: [PATCH] * Android - disable GL error check by default git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9141 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../renderer/android/OGLESShaderRenderer.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java index 343a68a19..41a1027d8 100644 --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java @@ -106,6 +106,7 @@ public class OGLESShaderRenderer implements Renderer { private boolean powerOf2 = false; private boolean verboseLogging = false; private boolean useVBO = false; + private boolean checkErrors = false; public OGLESShaderRenderer() { } @@ -131,6 +132,19 @@ public class OGLESShaderRenderer implements Renderer { nameBuf.rewind(); } + + private void checkGLError() { + if (!checkErrors) return; + int error; + while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) { + throw new RendererException("OpenGL Error " + error); + } + } + + private boolean log(String message) { + logger.info(message); + return true; + } public Statistics getStatistics() { return statistics; @@ -990,7 +1004,7 @@ public class OGLESShaderRenderer implements Renderer { logger.info("GLES20.glShaderSource(" + id + ")"); } - if (powerVr) { + if (powerVr && source.getType() == ShaderType.Vertex) { // XXX: This is to fix a bug in old PowerVR, remove // when no longer applicable. GLES20.glShaderSource( @@ -2751,19 +2765,6 @@ public class OGLESShaderRenderer implements Renderer { // } } - private void checkGLError() { - int error; - while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) { - logger.log(Level.WARNING, "glError {0}", error); - // throw new RuntimeException("glError " + error); - } - } - - private boolean log(String message) { - logger.info(message); - return true; - } - /** * drawTriangleList_Array uses Vertex Array * @param indexBuf