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.
Luminance alpha textures use LATC texture compression.
And because iPhone doesn't support EXT_texture_compression_latc
extension you can't use LATC textures on iPhone.
More info:
http://www.opengl.org/registry/specs/EXT/texture_compression_latc.txt
http://www.glbenchmark.com/phonedetails.jsp?benchmark=glpro25&D=Apple+iPhone+5&testgroup=gl
I found the issue by thinking about the fact that it runs on desktop but not on iOS. OpenGL textures using a format
and internal format
and 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 of LUMINANCE_ALPHA
in 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With