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

Commit 2eb29823 authored by Noelle Scobie's avatar Noelle Scobie
Browse files

Enable draw-based pipeline prewarming before Graphite's precompilation

As with Ganesh, the draws will block SF, but then the additional
pipelines covered by Graphite's precompilation will be compiled
asynchronously.

This change is intended as a temporary stopgap to de-risk missed
pipeline jank from cases that aren't yet added to Graphite's
precompilation.

Bug: b/380159947
Test: boot time tests and compariing pipelines generated
Flag: com.android.graphics.surfaceflinger.flags.graphite_renderengine
Change-Id: I79446083f420ed51d9cfe75042e7d7db1a260c73
parent 1e93a845
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -69,8 +69,15 @@ GraphiteVkRenderEngine::~GraphiteVkRenderEngine() {
std::future<void> GraphiteVkRenderEngine::primeCache(PrimeCacheConfig config) {
    std::future<void> ret = {};

    // Note: for local debugging only! Graphite's precompilation should stay ENABLED, and this
    // switch will be removed in the future without warning.
    // Note: this sysprop is for local debugging only! Legacy draw-based prewarming remains enabled
    // for Graphite TEMPORARILY, and this switch may be removed in the future without warning.
    // TODO(b/380159947): remove this option, and force just precompilation to always be enabled.
    if (base::GetBoolProperty("debug.renderengine.graphite.prewarm", true)) {
        ret = SkiaVkRenderEngine::primeCache(config);
    }

    // Note: this sysprop is for local debugging only! Graphite's precompilation should stay
    // ENABLED, and this switch may be removed in the future without warning.
    if (base::GetBoolProperty("debug.renderengine.graphite.precompile", true)) {
        std::unique_ptr<graphite::PrecompileContext> precompileContext =
                mContext->graphiteContext()->makePrecompileContext();
@@ -81,15 +88,6 @@ std::future<void> GraphiteVkRenderEngine::primeCache(PrimeCacheConfig config) {
        ALOGW("Graphite's background shader / pipeline precompilation was disabled!");
    }

    // Note: for local debugging only! Legacy draw-based prewarming should stay DISABLED, and this
    // switch will be removed  in the future without warning. Enabling this may regress boot time
    // unnecessarily.
    // TODO(b/380159947): remove this option, and force precompilation to always be enabled.
    if (base::GetBoolProperty("debug.renderengine.graphite.prewarm", false)) {
        ALOGW("Legacy draw-based shader / pipeline prewarming was enabled, and may delay boot!");
        ret = SkiaVkRenderEngine::primeCache(config);
    }

    return ret;
}