Android Gles20 Works On Bionic 4.1.2 But Not On Samsung 4.4.2
Solution 1:
GL_MAX_FRAGMENT_UNIFORM_VECTORS
is not the number of uniforms supported. It's an enum value that allows you to query that value. You get the actual value by calling:
int valA[] = newint[1];
GLES20.glGetIntegerv(GLES20.GL_MAX_FRAGMENT_UNIFORM_VECTORS, valA, 0);
int maxUniforms = valA[0];
The ES 2.0 spec requires implementations to support at least 16 uniform vectors. So it's theoretically possible that you're above the limit if you use 20. I would be surprised if the limit is really that low on a modern device, but you should definitely check.
As with any other kind of OpenGL problems, I'm sure that you already called glGetError()
, and checked the result.
Other than that, make sure that you check the result of shader compilations and linking with glGetShaderiv()
, glGetShaderInfoLog()
, glGetProgramiv()
, and glGetProgramInfoLog()
. Some GLSL compilers are stricter than others at enforcing standard compliance, so it's quite common that your shaders will work on some devices even though they contain errors.
Another thing you can try is to call glValidateProgram()
, and then check the result using glGetProgramiv()
with the GL_VALIDATE_STATUS
argument. This is best done after you set up all your state, immediately before making the first draw call. This can report problems with the program that could not be detected at compile/link time because they depend on the settings of other state.
Solution 2:
An update solved the problem. My Samsung device works now!
Post a Comment for "Android Gles20 Works On Bionic 4.1.2 But Not On Samsung 4.4.2"