cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

frazanardi
Journeyman III

OpenGL: TexStorage doesn't handle sRGB formats properly

When using TexStorage with sRGB formats, the sRGB part is ignored and the texture behaves as if it was created with the non-sRGB counterpart of the format.

For example:

- if I create a texture with TexStorage and then fill it with CompressedTexSubImage, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT will behave exactly as GL_COMPRESSED_RGBA_S3TC_DXT1_EXT.

- if I create and fill a texture with CompressedTexImage, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT and GL_COMPRESSED_RGBA_S3TC_DXT1_EXT will behave differently.

This problem does not occur on NVIDIA machines, so I'm guessing it's an AMD driver bug.

Edit: it seems that it's even more broken that that.. AFAIK

TexStorage2D(GL_TEXTURE_2D, 1, GL_DEPTH24_STENCIL8, 1024, 1024);

should work as a drop-in replacement for

TexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, 1024, 1024, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);

but in practice it doesn't work (i.e. it returns the same value everywhere when sampling). Again, working correctly on NVIDIA.

0 Likes
2 Replies
chris_f
Journeyman III

I've already reported this bug here: http://devgurus.amd.com/thread/167965

0 Likes
gsellers
Staff

Hi,

We have fixed both the sRGB and depth-stencils issues internally. I will look into getting those fixes released in a beta driver ASAP.

Thanks,

Graham

0 Likes