mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-27 12:21:11 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user