mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.3.3
This commit is contained in:
@@ -59,7 +59,10 @@ void worker() {
|
||||
}
|
||||
|
||||
void start() {
|
||||
const unsigned n = std::clamp(std::thread::hardware_concurrency() / 3, 2u, 4u);
|
||||
// (hookshot: with 16 hardware threads or more, 6 workers; RX_VK_WORKERS=<n>: n, 1 to 16)
|
||||
const unsigned hw = std::thread::hardware_concurrency();
|
||||
unsigned n = hw >= 16 ? 6u : std::clamp(hw / 3, 2u, 4u);
|
||||
if (const char* e = getenv("RX_VK_WORKERS")) n = (unsigned)std::clamp(atoi(e), 1, 16);
|
||||
for (unsigned i = 0; i < n; i++) std::thread(worker).detach();
|
||||
started = true;
|
||||
logf("vk: %u background workers (shader translation, pipelines)", n);
|
||||
|
||||
Reference in New Issue
Block a user