summaryrefslogtreecommitdiff
path: root/libs/rs/rsVertexArray.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2010-01-27 14:41:43 -0800
committer Jason Sams <rjsams@android.com> 2010-01-27 14:41:43 -0800
commit5dbfe93b3f15f3a837836d024958635fd8f9ad14 (patch)
tree7a86155c3054d0b7fe0d655e2f2dd21754b05330 /libs/rs/rsVertexArray.cpp
parent445cc0e4bfd5b9460fb1cdccd22d8d54a49e5da1 (diff)
Fix some minor bugs with GL state setup that were exposed by Droids driver.
Diffstat (limited to 'libs/rs/rsVertexArray.cpp')
-rw-r--r--libs/rs/rsVertexArray.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/rs/rsVertexArray.cpp b/libs/rs/rsVertexArray.cpp
index a1fd744250a4..d0c04148be37 100644
--- a/libs/rs/rsVertexArray.cpp
+++ b/libs/rs/rsVertexArray.cpp
@@ -180,10 +180,12 @@ void VertexArray::setupGL(const Context *rsc, class VertexArrayState *state) con
void VertexArray::setupGL2(const Context *rsc, class VertexArrayState *state, ShaderCache *sc) const
{
- for (int ct=1; ct < RS_MAX_ATTRIBS; ct++) {
+ rsc->checkError("VertexArray::setupGL2 start");
+ for (uint32_t ct=1; ct <= state->mLastEnableCount; ct++) {
glDisableVertexAttribArray(ct);
}
+ rsc->checkError("VertexArray::setupGL2 disabled");
for (uint32_t ct=0; ct < mCount; ct++) {
uint32_t slot = 0;
if (sc->isUserVertexProgram()) {
@@ -203,10 +205,12 @@ void VertexArray::setupGL2(const Context *rsc, class VertexArrayState *state, Sh
mAttribs[ct].stride,
(void *)mAttribs[ct].offset);
}
- rsc->checkError("VertexArray::setupGL2");
+ state->mLastEnableCount = mCount;
+ rsc->checkError("VertexArray::setupGL2 done");
}
////////////////////////////////////////////
void VertexArrayState::init(Context *) {
+ mLastEnableCount = 0;
}