* Possible fix for memory corruption issue on Android when compressed texture formats exceeds 16 entries.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10137 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f36b6c6e1e
commit
289c25e7e8
@ -308,9 +308,17 @@ public class OGLESShaderRenderer implements Renderer {
|
|||||||
String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);
|
String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS);
|
||||||
logger.log(Level.INFO, "GL_EXTENSIONS: {0}", extensions);
|
logger.log(Level.INFO, "GL_EXTENSIONS: {0}", extensions);
|
||||||
|
|
||||||
GLES20.glGetIntegerv(GLES20.GL_COMPRESSED_TEXTURE_FORMATS, intBuf16);
|
// Get number of compressed formats available.
|
||||||
for (int i = 0; i < intBuf16.limit(); i++) {
|
GLES20.glGetIntegerv(GLES20.GL_NUM_COMPRESSED_TEXTURE_FORMATS, intBuf16);
|
||||||
logger.log(Level.INFO, "Compressed Texture Formats: {0}", intBuf16.get(i));
|
int numCompressedFormats = intBuf16.get(0);
|
||||||
|
|
||||||
|
// Allocate buffer for compressed formats.
|
||||||
|
IntBuffer compressedFormats = BufferUtils.createIntBuffer(numCompressedFormats);
|
||||||
|
GLES20.glGetIntegerv(GLES20.GL_COMPRESSED_TEXTURE_FORMATS, compressedFormats);
|
||||||
|
|
||||||
|
// Print compressed formats.
|
||||||
|
for (int i = 0; i < numCompressedFormats; i++) {
|
||||||
|
logger.log(Level.INFO, "Compressed Texture Formats: {0}", compressedFormats.get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureUtil.loadTextureFeatures(extensions);
|
TextureUtil.loadTextureFeatures(extensions);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user