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

Commit f735c8e5 authored by Romain Guy's avatar Romain Guy
Browse files

Fix tiling on QCOM GPU

Rename Caches::startTiling parameter from opaque to discard to
make it clearer what its role is. Tweak calls to startTiling
to preserve the buffer when needed and discard it when possible.

Change-Id: If7f8ff19003f79f36885a0a7207cc61901f637d2
parent f158198c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -466,9 +466,9 @@ void Caches::resetScissor() {
// Tiling
///////////////////////////////////////////////////////////////////////////////

void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) {
void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard) {
    if (extensions.hasTiledRendering() && !debugOverdraw) {
        glStartTilingQCOM(x, y, width, height, (opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM));
        glStartTilingQCOM(x, y, width, height, (discard ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM));
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ public:
    bool disableScissor();
    void setScissorEnabled(bool enabled);

    void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque);
    void startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool preserve);
    void endTiling();

    /**
+2 −2
Original line number Diff line number Diff line
@@ -818,7 +818,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, Rect& clip, GLui
    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
            layer->getTexture(), 0);

    startTiling(mSnapshot, !layer->isBlend());
    startTiling(mSnapshot, true);

    // Clear the FBO, expand the clear region by 1 to get nice bilinear filtering
    mCaches.enableScissor();
@@ -1267,7 +1267,7 @@ void OpenGLRenderer::attachStencilBufferToLayer(Layer* layer) {

        glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, buffer);

        startTiling(layer->clipRect, layer->layer.getHeight(), !layer->isBlend());
        startTiling(layer->clipRect, layer->layer.getHeight());
    }
}