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

Commit 5c49a908 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change Ic73ec39b into eclair

* changes:
  DO NOT MERGE. Implement WAR which should prevent the white square bug from appearing on user devices.  If we see a 0 texture id during bind for rendering, attempt to re-upload.  If this fails log debug info and restart the app.
parents 5d0806c9 c73ec39b
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -65,6 +65,20 @@ void ProgramFragment::setupGL(const Context *rsc, ProgramFragmentState *state)
            }
            glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
        }

        rsAssert(mTextures[ct]->getTextureID() != 0);
        if (mTextures[ct]->getTextureID() == 0) {
            // This is a hack for eclair to try to fix the white squares bug.
            Allocation *a = (Allocation *)mTextures[ct].get();
            a->uploadToTexture((Context *)rsc, 0);
            if (mTextures[ct]->getTextureID() == 0) {
                // At this point we are screwed.  Crash to restart the app.
                rsc->dumpDebug();
                LOGE("Multiple failures during texture upload.  Driver appears wedged.");
                ((char *)0)[0] = 0;
            }

        }
        glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());

        switch(mEnvModes[ct]) {