Previous
[Working record] Android OpenGL ES 2.0:square Texture not supported on some device
Recently I found that it's the mipmap of a non-square texture that cause the black texture problem:
Http://stackoverflow.com/questions/5052762/using-mipmaps-results-in-garbage-textures
The texture resource data (on disk) already has mipmap chains generated,
But some textures don ' t has full mipmap chain down to 1x1. i.e. some only has 4/3 levels by configuration.
And also, we stop update mipmap on NX1 or 1xn at runtime.
This was okay on the most graphics devices (PC DX9/XBOX/PC3 etc.)
But the major problem was that OpenGL ES 2.0 lacks for definition of behavior on Non-square texture mipmaps (implemention def ined behavior). So the gpu/drivers is free-to-do-what they want,
For the this case, they just consider a texture "in-complete" if it does has full mipmap chain (down to 1x1). So to the shader, it's just like a empty sampler bound to no textures. That ' s the reason of black textures.
Based on test results, this problem never happens on GLES3.0 api/devices, but happens on some GLES2.0 devices, and some de Vices with GLES3.0 capable hardware with 2.0 system runtime API.