VK: scale auto shader compiler workers on wide CPUs
This commit is contained in:
@@ -216,16 +216,27 @@ namespace vk
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize_pipe_compiler(int num_worker_threads)
|
void initialize_pipe_compiler(int num_worker_threads)
|
||||||
{
|
{
|
||||||
if (num_worker_threads == 0)
|
if (num_worker_threads == 0)
|
||||||
{
|
{
|
||||||
// Select optimal number of compiler threads
|
// Select a conservative but modern default for async pipeline compilation.
|
||||||
const auto hw_threads = utils::get_thread_count();
|
// Older heuristics topped out too early on high-core CPUs and left large
|
||||||
if (hw_threads > 12)
|
// shader bursts queued longer than necessary.
|
||||||
{
|
const auto hw_threads = utils::get_thread_count();
|
||||||
num_worker_threads = 6;
|
|
||||||
}
|
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)
|
else if (hw_threads > 8)
|
||||||
{
|
{
|
||||||
num_worker_threads = 4;
|
num_worker_threads = 4;
|
||||||
@@ -234,11 +245,14 @@ namespace vk
|
|||||||
{
|
{
|
||||||
num_worker_threads = 2;
|
num_worker_threads = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
num_worker_threads = 1;
|
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(num_worker_threads >= 1);
|
||||||
ensure(g_render_device); // "Cannot initialize pipe compiler before creating a logical device"
|
ensure(g_render_device); // "Cannot initialize pipe compiler before creating a logical device"
|
||||||
|
|||||||
Reference in New Issue
Block a user