summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsVertexArray.cpp
diff options
context:
space:
mode:
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 a1fd744..d0c0414 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;
}