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

Commit 5019546c authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 65f4effc: Merge "Discard the correct buffer when the bound FBO is not 0"

# Via Android (Google) Code Review (1) and Romain Guy (1)
* commit '65f4effc':
  Discard the correct buffer when the bound FBO is not 0
parents 739827f3 65f4effc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -206,8 +206,10 @@ void OpenGLRenderer::discardFramebuffer(float left, float top, float right, floa
    // the back buffer for this frame.
    if (mCaches.extensions.hasDiscardFramebuffer() &&
            left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) {
        const GLenum attachments[] = { getTargetFbo() == 0 ? (const GLenum) GL_COLOR_EXT :
                (const GLenum) GL_COLOR_ATTACHMENT0, GL_STENCIL_EXT };
        const bool isFbo = getTargetFbo() == 0;
        const GLenum attachments[] = {
                isFbo ? (const GLenum) GL_COLOR_EXT : (const GLenum) GL_COLOR_ATTACHMENT0,
                isFbo ? (const GLenum) GL_STENCIL_EXT : (const GLenum) GL_STENCIL_ATTACHMENT };
        glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments);
    }
}