Calculate correct size for compressed cubemap face data

* GL_TEXTURE_COMPRESSED_IMAGE_SIZE glGet value gives you the size for all
  faces on this mip, but we fetch the image data face-by-face, so it needs
  a /6.
This commit is contained in:
baldurk
2014-11-10 23:46:44 +00:00
parent 9e60ce8959
commit 513ace06ec
+5
View File
@@ -303,6 +303,11 @@ bool GLResourceManager::Serialise_InitialState(GLResource res)
size_t size = compSize;
// cubemaps return the compressed image size for the whole texture, but we read it
// face by face
if(details.curType == eGL_TEXTURE_CUBE_MAP)
size /= 6;
byte *buf = new byte[size];
gl.glGetCompressedTextureImageEXT(tex, targets[trg], i, buf);