Triforce v0.3.3

This commit is contained in:
ruckus7382sfgsgdf
2026-11-12 10:54:34 -06:00
parent afbb0d140a
commit 83b5be58d6
37 changed files with 5438 additions and 145 deletions

View File

@@ -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);