Search code examples
opengl-estexturesmipmapsopengl-es-3.0

Issue with RGBA32F texture format and mipmapping using OpenGL ES 3.0


When I use glGenerateMipmap() to generate mipmap for a RGBA32F texture, it always comes to an INVALID_OPERATION error. Binding texture or setting many kinds of texture parameters didn't work.

From OpenGL ES 3.0 specification, I find that RGBA32F is not filterable. So is this the reason for the error?

Unfortunately, I can't find any "supported texture formats" tips in the api docs of function glGenerateMipmap. If so, then why is RGBA16F works well but 32bit float does not?

thanks~


Solution

  • From the OpenGL ES 3.0 specification, Section 3.8.10.5:

    If the levelbase array was not specified with an unsized internal format from table 3.3 or a sized internal format that is both color-renderable and texture-filterable according to table 3.13, an INVALID_OPERATION error is generated. (emphasis added)

    You already stated that RGBA32F is not texture-filterable while RGBA16F is, which is the reason why it is working in the latter case but not in the first.

    Also the docs mention that explicitly in the error list:

    GL_INVALID_OPERATION is generated if the levelbaselevelbase array was not specified with an unsized internal format or a sized internal format that is both color-renderable and texture-filterable.