From 4d69577228fc301ed5901bfc8d92b44fe43ba3f3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 7 Feb 2012 12:02:04 +0000 Subject: [PATCH] From Johannes Baeuerle, "The first problem is wrong value of the block size of etc1 textures in the getCompressedSize call in Texture.cpp. With the current block size of 16 the target application crashes with a GL_INVALID_VALUE. The reason is that the calculated size passed to OpenGL does not match the size of the passed data(data pointer,texture width,texture height,spec of etc1). With a block size of 8 in the getCompressedSize call this error dissapears." --- src/osg/Texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 83affc2be..886384004 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -1563,7 +1563,7 @@ void Texture::getCompressedSize(GLenum internalFormat, GLint width, GLint height else if (internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT || internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) blockSize = 16; else if (internalFormat == GL_ETC1_RGB8_OES) - blockSize = 16; + blockSize = 8; else if (internalFormat == GL_COMPRESSED_RED_RGTC1_EXT || internalFormat == GL_COMPRESSED_SIGNED_RED_RGTC1_EXT) blockSize = 8; else if (internalFormat == GL_COMPRESSED_RED_GREEN_RGTC2_EXT || internalFormat == GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT)