From 5274210ba8307f1c0a45a8398d3ba9e9c8840f19 Mon Sep 17 00:00:00 2001 From: jfleezy23 Date: Sun, 15 Mar 2026 01:53:07 -0700 Subject: [PATCH] VK: scale auto shader compiler workers on wide CPUs --- rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp | 44 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp index 26e0b64098..99462e0602 100644 --- a/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp +++ b/rpcs3/Emu/RSX/VK/VKPipelineCompiler.cpp @@ -216,16 +216,27 @@ namespace vk return {}; } - void initialize_pipe_compiler(int num_worker_threads) - { - if (num_worker_threads == 0) - { - // Select optimal number of compiler threads - const auto hw_threads = utils::get_thread_count(); - if (hw_threads > 12) - { - num_worker_threads = 6; - } + void initialize_pipe_compiler(int num_worker_threads) + { + if (num_worker_threads == 0) + { + // Select a conservative but modern default for async pipeline compilation. + // Older heuristics topped out too early on high-core CPUs and left large + // shader bursts queued longer than necessary. + const auto hw_threads = utils::get_thread_count(); + + if (hw_threads >= 24) + { + num_worker_threads = 12; + } + else if (hw_threads >= 16) + { + num_worker_threads = 8; + } + else if (hw_threads > 12) + { + num_worker_threads = 6; + } else if (hw_threads > 8) { num_worker_threads = 4; @@ -234,11 +245,14 @@ namespace vk { num_worker_threads = 2; } - else - { - num_worker_threads = 1; - } - } + else + { + num_worker_threads = 1; + } + + rsx_log.notice("Async pipeline compiler auto-selected %d worker(s) for %u host thread(s).", + num_worker_threads, hw_threads); + } ensure(num_worker_threads >= 1); ensure(g_render_device); // "Cannot initialize pipe compiler before creating a logical device"