mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
opengl: fix creating compressed array textures with > 1 layer.
Fixes #1817.
This commit is contained in:
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user