From 954864ea809f034ed78e034807de18b5d7518972 Mon Sep 17 00:00:00 2001 From: Dean Galvin Date: Thu, 8 Oct 2026 17:44:31 +1300 Subject: [PATCH] perf(agc): keep up to 1024 cached pipelines CachedPipeline keeps at most 256 pipelines. A level with a larger working set thrashes the LRU: every miss creates a new VkPipeline (modules, layout, render pass and a driver compile from the pipeline cache). The bound is now 1024. A cached pipeline is a pure function of its key, so the bound changes only memory and time. --- core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp index 3f932eeaa..5cdd8fa57 100644 --- a/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp +++ b/core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp @@ -558,7 +558,7 @@ std::shared_ptr CachedPipeline(const Context& context, const State& st auto pipeline = std::make_shared(context, state, vertexInput, resources, shaders, attachmentLayout); store.entries.push_back({context.device, context.bufferPool, hash, key, pipeline}); store.index[hash] = std::prev(store.entries.end()); - constexpr std::size_t bound = 256; + constexpr std::size_t bound = 1024; while (store.entries.size() > bound) { // Only an entry no recorded draw still holds may go (Kept keeps its shared_ptr until the fence). const auto victim = std::find_if(store.entries.begin(), store.entries.end(), [](const PipelineStore::Entry& entry) { return entry.pipeline.use_count() == 1; });