I spent the whole day trying to find out why glCompressedTexSubImage2D was returning INVALID_OPERATION when everything seemed to be fine.
I was working with FBOs & sub texture updates; so my guesses were:
After 2 hours with CodeXL, I suddenly notice hwGamma in my code was true. Turns out, the GL buffer was being created with GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; but in glCompressedTexSubImage2D, the format being specified was GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
My suggestion is... pleaseeee!!! For the love of God, add Debug messages when supplying wrong parameters to glCompressedTexSubImage** family of functions. Diagnostics would include:
Tiny details like this would certainly help all developers and we will greatly appreciate, helping us to fix a problem that could be resolved in 2 minutes instead of wasting a whole day.
Simply an "INVALID_OPERATION" can be quite frustrating to deal with.
Just my feedback
Thanks in advance!
Matías.