Frank Schlegel Frank Schlegel - 2 months ago 31
iOS Question

OpenGL errors on A7-devices in iOS 10

My image processing app behaves really strange on devices with an A7 chip (iPhone 5s and iPad Mini 2 tested) after the update to iOS 10:

Rendering takes extremely long and produces broken results. Instruments reveals that some of the

glDrawElements
calls return with
GL_INVALID_OPERATION
. I couldn't make out the cause for that, though.

The same code runs perfectly fine on newer devices (A8 and better) and on all devices in iOS 9. Did Apple change things I am not aware of?

Some more background info:


  • I'm partially using textures of
    GL_HALF_FLOAT_OES
    type

  • I make use of the
    EXT_color_buffer_half_float
    extension to render into those textures

  • I use the
    EXT_shader_framebuffer_fetch
    extension to process pixels in some of my filters in-place


Answer

As it turns out I was only partially assigning gl_FragColor in some of my shaders (e.g., gl_FragColor.rg = vec2(1.0, 0.0);), which caused the erroneous behavior in iOS 10. Possibly only in combination with a GL_HALF_FLOAT_OES-typed render target, though.

When I always assign the full vector (even though the other parts are unused…), it works like a charm.

Comments