I’ve experienced a problem with glCopyImageSubData. I try to copy a compressed DXT1 2D texture array to another compressed DXT1 2D texture array with the same dimensionality. All mip levels copied except the two smallest (1x1 and 2x2) - they stay unchanged (in the destination texture) after copying.
Why does it happen?
for (int level = 0; level < levelCount; ++ level)
int mipWidth = GetTextureMipWidth(srcTex, level);
int mipHeight = GetTextureMipHeight(srcTex, level);
glCopyImageSubData(srcTex, GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, dstTex, GL_TEXTURE_2D_ARRAY, level, 0, 0, 0, mipWidth, mipHeight, arraySize);
glGetCompressedTexImage(GL_TEXTURE_2D_ARRAY, level, dstData);
Why does these two mip levels didn’t copy?
And even glGetError() doesn’t return an error after glCopyImageSubData().
Are you sure levelCount is what it needs to be? What is the width and height of the base map as well as levelCount?
If those check out, I have one thought for you. It probably goes without saying that with a DXT1 compressed texture, if your base map width and height are a power of 2, that 2x2 and 1x1 are the only MIPs where the driver has to deal with the resolution not exactly filling a full DXT 4x4 block. Now there’s language in EXT_texture_compression_s3tc for CopyTexSubImage2D and friends which suggests that that in such cases you provide the true resolution, not the resolution rounded up to the next 4x4 DXT block size. But you might try 4x4 for width/height of the 2x2 and 1x1 MIPs just for kicks to see if that works. If so, I’d run it to ground because I think that might be a bug.