Fire TV OpenGL ES 2.0 Rendering Glitch

Expected (Observed on other platforms and Android devices):

Actual Fire TV Mali-450 MP OpenGL ES 2.0:

My second quad is rendered ONLY IN THE REGION where the first quad rendered! It is composed of two triangles whose vertices and texture coordinates are ultimately bound with glBindVertexArray. I have tried blending and also depth testing enabled and various Z depths and also reversing them without any luck. No matter what I do it seems like at most only a single quad will render, I have tried various shader programs that work in isolation but I only manage to get one draw call visible (If I commend out the second call, the first one works).

glDrawArrays(GL_TRIANGLES, 0, 6);
// matrix b offset by (-0.8f, 0.5f, -0.1f)
glUniformMatrix4fv(uniformLocations->ui_modelMatrix, 1, GL_FALSE, &b[0][0]);
glDrawArrays(GL_TRIANGLES, 0, 6);

My one theory goes, that this has to do with the shear number of glUniform4f (7x) I’m sending to the bound shader, but its really not that many . I may move towards " Uniform buffer objects" and see how that works but I don’t think it will solve the issue.

If I have some time I may try to port “test/testshader.c” to opengles2 and see if that works on this device, given what I have observed I think there is no way it can work under opengles2 on the Fire TV Mali-450 but maybe there is some nuance to the way I am drawing or binding that is unsupported on this device.

Any two or more consecutive draw calls that do not overlap results in a blank screen. When 3 overlap only the 3x overlapping portion of the 3rd draw call is visible.

If anyone has run into this and knows a work around I’ll be forever in your debt. Thanks!

I figured it out…

Eliminating all my calls to glGenVertexArrays resolves the issue, and to avoid GL-Errors also removing calls to glBindVertexArray - everything else works great!

Turns out these functions are not available in all OpenGL ES 2.0 environments. It depends on what extensions are available. I had been using some nasty defines to work around the issue (which it turns out was a bad idea to depend on these calls working):

#define glGenVertexArrays glGenVertexArraysOES
#define glBindVertexArray glBindVertexArrayOES

glBindBuffer and glBufferData work great though! It’s just not possible to wrap all of them into a single VertexArray object.

I will have to do more testing, but it seems like my solution may involve performing these steps instead when I want to change objects:

glBindBuffer(GL_ARRAY_BUFFER, rect_position_vboID);
glVertexAttribPointer(SHADER_POSITION, 3, GL_FLOAT, GL_FALSE, 0, 0);

For each component previously bound to the VAO. Hopefully this helps someone else!