I’m trying to integrate KTX support into my application, but I’m encountering some issues trying to make sure my KTX serializer and parser code is correct. I’m currently trying to write a validation routine and I’m getting failures when I apply it to the example files in https://github.com/KhronosGroup/KTX/tree/master/testimages
down-reference.ktx contains an internal format of GL_RGB. I thought that internal format was intended to be a sized format.
etc2-sRGB.ktx contains a base internal format of GL_SRGB. I’m unclear on the interaction between SRGB and KTX. https://forums.khronos.org/showthread.php/9572-Storing-color-space-in-KeyValue-data seems to indicate that you should be able to store SRGB data and mark it as such in the glInternalFormat field, but should the corresponding glBaseInternalFormat then be GL_RGB or GL_SRGB? Given that the spec states that glBaseInternalFormat is only for use when contexts don’t support sized format, such as unextended OpenGL ES 2.0 and GL ES 2.0 also doesn’t support SRGB, it seems like this should be GL_RGB.
Both etc2-sRGBa1.ktx and etc2-sRGBa8.ktx have a base internal format of GL_SRGB8_ALPHA8. This seems to defy the spec in two ways, first by being an SRGB reference, based on my point above, and second, by being a sized format, rather than an unsized one, such as GL_RGBA or even GL_SRGB_ALPHA.
Can anyone explain how my validation of these is incorrect based on the spec, or alternatively confirm that these values don’t make sense?