opengl: GLEncoder: Fix potential array buffer misbinding

When encoding a glDrawElements() or glDrawArrays() call, the encoder
needs to figure out whether each array (e.g. vertex, color, etc.) uses
a bound buffer or not. It is possible that some arrays use bound buffers
while others immediate buffers. In this case, there is a chance that the
encoder fails to preserve the semantics of the input GLES calls,
resulting in misinterpretation by the translator that all arrays use
bound buffers.

Fix this by encoding an unbind operation before any glXXXPointer() call
that does not mean to use a bound buffer. For GLESv2, that is already
done:

 40a674e Fix emulator crashes on glDrawElements command

This CL does the same for GLESv1.

Change-Id: Ifd17321b124a4f4b1037a43d5a54094541d367f1
Signed-off-by: Yu Ning <yu.ning@intel.com>
1 file changed