I have a Samsung Galaxy Tab 3 (Android 4.2.2) and the depth buffer doesn't seem to work. Any other devices are ok. I create the context as follows:
setEGLContextClientVersion(2);
setEGLConfigChooser(new MultisampleConfigChooser(...));
// ...
@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
mValue = new int[1];
// Try to find a normal multisample configuration first.
int[] configSpec = {
EGL10.EGL_RED_SIZE, 5,
EGL10.EGL_GREEN_SIZE, 6,
EGL10.EGL_BLUE_SIZE, 5,
EGL10.EGL_DEPTH_SIZE, 16,
// Requires that setEGLContextClientVersion(2) is called on the view.
EGL10.EGL_RENDERABLE_TYPE, 4 /* EGL_OPENGL_ES2_BIT */,
EGL10.EGL_SAMPLE_BUFFERS, (!mDisableMultisampling ? 1 : 0)/* true */,
EGL10.EGL_SAMPLES, (!mDisableMultisampling ? 2 : 0),
EGL10.EGL_STENCIL_SIZE, 8,
EGL10.EGL_NONE
};
if (!egl.eglChooseConfig(display, configSpec, null, 0, mValue)) {
// ...
}
...
}
I tried the following things:
Projection matrix is OK (the program works on any other Android device, as well as on iOS).
What might cause the problem?
"User error." Apparently glDepthMask accepts values greater than 1 on every GPU except Vivante. Finding this out and forcing it to 0 or 1 solved the problem.