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

Commit 0eb8851e authored by Jamie Gennis's avatar Jamie Gennis
Browse files

Clear GL errors before updating a SurfaceTexture.

Change-Id: Ibdac657ae9e9ccae53c63abed9caf1f1513915c2
parent a2e8538a
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -219,11 +219,19 @@ status_t SurfaceTexture::updateTexImage() {
            mSlots[mLastQueued].mEglImage = image;
            mSlots[mLastQueued].mEglDisplay = dpy;
        }

        GLint error;
        while ((error = glGetError()) != GL_NO_ERROR) {
            LOGE("GL error cleared before updating SurfaceTexture: %#04x", error);
        }
        glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)image);
        GLint error = glGetError();
        if (error != GL_NO_ERROR) {
        bool failed = false;
        while ((error = glGetError()) != GL_NO_ERROR) {
            LOGE("error binding external texture image %p (slot %d): %#04x",
                    image, mLastQueued, error);
            failed = true;
        }
        if (failed) {
            return -EINVAL;
        }