From d49de734b7a607da6c9f7b1e525300e808a9d92a Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 15 Nov 2018 12:19:24 +0100 Subject: [PATCH] [dxvk] Set low thread priority for pipeline compiler threads This currently does not have any effect when using regular wine, but if it ever gets supported then these background jobs should have less of an influence on the game's performance when they kick in. --- src/dxvk/dxvk_state_cache.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dxvk/dxvk_state_cache.cpp b/src/dxvk/dxvk_state_cache.cpp index c7efeb6c5..ca8733e08 100644 --- a/src/dxvk/dxvk_state_cache.cpp +++ b/src/dxvk/dxvk_state_cache.cpp @@ -74,8 +74,10 @@ namespace dxvk { Logger::info(str::format("DXVK: Using ", numWorkers, " compiler threads")); // Start the worker threads and the file writer - for (uint32_t i = 0; i < numWorkers; i++) + for (uint32_t i = 0; i < numWorkers; i++) { m_workerThreads.emplace_back([this] () { workerFunc(); }); + m_workerThreads[i].set_priority(ThreadPriority::Lowest); + } m_writerThread = dxvk::thread([this] () { writerFunc(); }); }