This is my (wrapped) OpenGL call which causes a GL_INVALID_OPERATION:
GLTextures.TexImage2D(TexImage2DTarget.TEXTURE_2D, 0, TexImageInternalFormat.LUMINANCE_ALPHA, Width, Height, TexImageFormat.LUMINANCE_ALPHA, TexImagePixelType.UNSIGNED_BYTE, source.GetData());
This call works on Windows but not on iOS, in Windows everything works fine and the texture is displayed. I use the same enum-values on iOS and Windows and even the shader is the same ( with some precision hints on iOS ). Also the most textures are working on iOS.
I found the issue by thinking about the fact that it runs on desktop but not on iOS. OpenGL textures using a
formatandinternal formatand are AFAIK converted from one to another format when the formats are different but the OpenGL ES 2.0 implementation of Apple isn’t supporting this.It came in my mind that this can be the only issue for the not working textures and the
GL_INVALID_OPERATION. I checked my enums and found out that the definition ofLUMINANCE_ALPHAin one enum had no value assigned and just used the number of the definition before + 1. OpenGL ignores this on desktop because the number has been a valid texture format, on iOS it fails.