|
|
@ -106,6 +106,7 @@ public class OGLESShaderRenderer implements Renderer { |
|
|
|
private boolean powerOf2 = false; |
|
|
|
private boolean powerOf2 = false; |
|
|
|
private boolean verboseLogging = false; |
|
|
|
private boolean verboseLogging = false; |
|
|
|
private boolean useVBO = false; |
|
|
|
private boolean useVBO = false; |
|
|
|
|
|
|
|
private boolean checkErrors = false; |
|
|
|
|
|
|
|
|
|
|
|
public OGLESShaderRenderer() { |
|
|
|
public OGLESShaderRenderer() { |
|
|
|
} |
|
|
|
} |
|
|
@ -131,6 +132,19 @@ public class OGLESShaderRenderer implements Renderer { |
|
|
|
|
|
|
|
|
|
|
|
nameBuf.rewind(); |
|
|
|
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() { |
|
|
|
public Statistics getStatistics() { |
|
|
|
return statistics; |
|
|
|
return statistics; |
|
|
@ -990,7 +1004,7 @@ public class OGLESShaderRenderer implements Renderer { |
|
|
|
logger.info("GLES20.glShaderSource(" + id + ")"); |
|
|
|
logger.info("GLES20.glShaderSource(" + id + ")"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (powerVr) { |
|
|
|
if (powerVr && source.getType() == ShaderType.Vertex) { |
|
|
|
// XXX: This is to fix a bug in old PowerVR, remove
|
|
|
|
// XXX: This is to fix a bug in old PowerVR, remove
|
|
|
|
// when no longer applicable.
|
|
|
|
// when no longer applicable.
|
|
|
|
GLES20.glShaderSource( |
|
|
|
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 |
|
|
|
* drawTriangleList_Array uses Vertex Array |
|
|
|
* @param indexBuf |
|
|
|
* @param indexBuf |
|
|
|