cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

squishynewt
Journeyman III

OpenGL glGenerateMipmap changes internalformat

This used to work on 22.5 drivers but is broken on 22.7? Radeon RX 6700 XT. Code works fine on Nvidia based system.

Call glGenerateMipmap on a compressed texture (lod=0) causes all lod(0-4) to be converted to uncompressed format.

Documentation states: "The internal formats of the derived mipmap images all match those of the levelbase image."

 

Spoiler

Dim texID As Integer = GL.GenTexture()
GL.BindTexture(TextureTarget.Texture2D, texID)

GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureBaseLevel, 0)
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMaxLevel, 4)

Dim ft As Integer
GL.GetTexLevelParameter(TextureTarget.Texture2D, 0, GetTextureParameter.TextureInternalFormat, ft)
Debug.WriteLine(ft) ' OUTPUTS 33777 = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT

GL.GenerateMipmap(GenerateMipmapTarget.Texture2D)
GL.GetTexLevelParameter(TextureTarget.Texture2D, 0, GetTextureParameter.TextureInternalFormat, ft)

Debug.WriteLine(ft) ' OUTPUTS 32856 = GL_RGBA8 ???

0 Likes
3 Replies
dipak
Staff

Hi @squishynewt 

Thank you for reporting it. I have whitelisted you and moved the post to the OpenGL forum.

Thanks.

0 Likes
dipak
Staff

I have reported the issue to the OpenGL team. I will let you know if I get any update on this.

Thanks.

0 Likes
dipak
Staff

Just to let you know, the OpenGL team has investigated this issue and they have implemented a fix internally.

Thanks.

0 Likes