I’m trying to compress a texture to BPTC using this code but I am getting a corrupted image.
glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, 512, 512);
glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
On the other had, if I use this it works.
glTextureImage2DEXT(texture, GL_TEXTURE_2D, 0, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
Also, if I do this:
glTextureStorage2DEXT(texture, GL_TEXTURE_2D, 10, GL_SRGB8_ALPHA8, 512, 512);
glTextureSubImage2DEXT(texture, GL_TEXTURE_2D, 0, 0, 0, 512, 512, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
My texture appears overexposed, but if I do this:
glTextureImage2DEXT(texture, GL_TEXTURE_2D, 0, GL_SRGB8_ALPHA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, image_buffer);
It appears correctly.
For the record, glGetError and KHR_debug report no errors and nothing changes if I used the non-direct_state_access versions of these functions. Can somebody please tell me if I am using these functions incorrectly or if this is a driver bug.