Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ab2d184 authored by Chris Craik's avatar Chris Craik
Browse files

Ensure glActiveTexture is cleaned up correctly on functor resume

Change-Id: I103d7d63b17289d599c2c08dcc442cfba9b8e51d
parent 7bfddb54
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -495,6 +495,10 @@ void Caches::activeTexture(GLuint textureUnit) {
    }
}

void Caches::resetActiveTexture() {
    mTextureUnit = -1;
}

void Caches::bindTexture(GLuint texture) {
    if (mBoundTextures[mTextureUnit] != texture) {
        glBindTexture(GL_TEXTURE_2D, texture);
+5 −0
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ public:
     */
    void activeTexture(GLuint textureUnit);

    /**
     * Invalidate the cached value of the active texture unit.
     */
    void resetActiveTexture();

    /**
     * Binds the specified texture as a GL_TEXTURE_2D texture.
     * All texture bindings must be performed with this method or
+1 −0
Original line number Diff line number Diff line
@@ -351,6 +351,7 @@ void OpenGLRenderer::interrupt() {
            mCaches.currentProgram = NULL;
        }
    }
    mCaches.resetActiveTexture();
    mCaches.unbindMeshBuffer();
    mCaches.unbindIndicesBuffer();
    mCaches.resetVertexPointers();