cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

Highlighted
Journeyman III
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 Kudos
Reply
2 Replies
Highlighted
Journeyman III
Journeyman III

Re: OpenGL: TexStorage doesn't handle sRGB formats properly

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

0 Kudos
Reply
Highlighted
Staff
Staff

Re: OpenGL: TexStorage doesn't handle sRGB formats properly

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 Kudos
Reply