I’m trying to load up a KTX file I encoded from a PNG in PVRTexTool in my application, but the file won’t load. The original image is a roughness map and I encoded it as GL_RED8 with mipmap generation.
I traced into the code it appears to be an issue with the image sizes. When I get down to the 2x2 mip, the file reports an image size of 4 bytes. However, the KTX specification says
[blockquote]Uncompressed texture data matches a GL_UNPACK_ALIGNMENT of 4.[/blockquote]
meaning that each row of the image data must be 4 byte aligned. So the image size should be 8, not 4 (2 rows of 4 bytes each, the first two of which are the pixel data, and the remaining two as padding).
Is my reading of the KTX spec incorrect?