VK: scale auto shader compiler workers on wide CPUs

This commit is contained in:
jfleezy23
2026-03-15 01:53:07 -07:00
committed by kd-11
parent 1627757608
commit 5274210ba8
+29 -15
View File
@@ -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"