OSDN Git Service

[cherry-pick] opengl: GLEncoder: Fix potential array buffer misbinding
authorYu Ning <yu.ning@intel.com>
Wed, 19 Aug 2015 07:22:13 +0000 (15:22 +0800)
committerYahan Zhou <yahan@google.com>
Wed, 1 Jun 2016 17:25:13 +0000 (10:25 -0700)
commitcc6b1cd05588e85e482803bbaf7a37bbff1ba42c
treec7fbd265a404aba2748a9103590d0ce6bcda5b7b
parent2d4908df5328f839da292c72692bfe3b555b66cb
[cherry-pick] 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.

Cherry-pick from:

https://android-review.googlesource.com/#/c/167443/

Change-Id: Ifd17321b124a4f4b1037a43d5a54094541d367f1
Signed-off-by: Yu Ning <yu.ning@intel.com>
system/GLESv1_enc/GLEncoder.cpp