1

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~

BDL
  • 21,052
  • 22
  • 49
  • 55
zhy
  • 103
  • 2
  • 9

1 Answers1

1

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.

BDL
  • 21,052
  • 22
  • 49
  • 55
  • oh, thanks! I read that, but I didn't fully understand it. I have a confusion. According to the statement, `RGBA16F` (not color-renderable, but filterable) should also get an error, but actually it works? – zhy Jun 26 '17 at 10:08
  • 1
    Some GPUs support more than the spec requires via extensions, or support newer OpenGL ES versions. OpenGL ES 3.2 requires RGBA16F to be renderable and filterable, and will be enabled automatically for a 3.x context if the driver supports it. I'd guess your context actually supports all or some of OpenGL ES 3.2 (most of the newer GPUs on the market do). – solidpixel Jun 27 '17 at 09:30
  • @solidpixel you should be right. The final result differs on specific hardwares. – zhy Jun 28 '17 at 06:22