opengl-esios10glkit

Your app called glInvalidateFramebuffer before presenting renderbuffer


"Your app called glInvalidateFramebuffer before presenting renderbuffer" is an error message I get in the line:

int retVal = UIApplicationMain(argc, argv, nil, @"myAppDelegate");

of my main.m file.

There is not a single call to the glInvalidateFramebuffer method in my project. What is more, the project uses OpenGL ES 2.0 (running with a GLKView) and the problematic method is part of OpenGL ES 3.0.

I use a number of offscreen frame buffers to draw procedural textures. This error was not notified before iOS 10. Also, it does not prevent rendering, does not show any visible issues and it is impossible to indicate its exact place in code (other than main.m) using Capture Frame.


Solution

  • This is almost certainly a false alarm by XCode's GPU Report.

    When presenting, both the multi sample buffer and the depth buffer are no longer required. The multi sample buffer has already been resolved, and to present the pixels, the depth values are no longer necessary.

    This means that GLKView does the correct thing: invalidate them before presenting.

    Note: the false warning goes away with GLKViewDrawableMultisampleNone instead of 4x.

    So in GLK's case, it is triggered by the invalidation of the multi sample buffer after resolving.