|
@@ -116,16 +116,14 @@ void Image::loadData()
|
|
|
{
|
|
|
if (isCompressed() && (texType == TEXTURE_2D_ARRAY || texType == TEXTURE_VOLUME))
|
|
|
{
|
|
|
+ int mipslices = data.getSliceCount(mip);
|
|
|
size_t mipsize = 0;
|
|
|
|
|
|
- if (texType == TEXTURE_2D_ARRAY || texType == TEXTURE_VOLUME)
|
|
|
- {
|
|
|
- for (int slice = 0; slice < data.getSliceCount(mip); slice++)
|
|
|
- mipsize += data.get(slice, mip)->getSize();
|
|
|
- }
|
|
|
+ for (int slice = 0; slice < mipslices; slice++)
|
|
|
+ mipsize += data.get(slice, mip)->getSize();
|
|
|
|
|
|
GLenum gltarget = OpenGL::getGLTextureType(texType);
|
|
|
- glCompressedTexImage3D(gltarget, mip, fmt.internalformat, w, h, d, 0, mipsize, nullptr);
|
|
|
+ glCompressedTexImage3D(gltarget, mip, fmt.internalformat, w, h, mipslices, 0, mipsize, nullptr);
|
|
|
}
|
|
|
|
|
|
for (int slice = 0; slice < slicecount; slice++)
|