From 2ee80ce1bdbd3430e61b5e65d2e185a01f7533ba Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 13 May 2018 15:37:31 +0200 Subject: [PATCH] [dxvk] Log start/stop of pipe compiler worker threads --- src/dxvk/dxvk_pipecompiler.cpp | 14 ++++++++++---- src/dxvk/dxvk_pipecompiler.h | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/dxvk/dxvk_pipecompiler.cpp b/src/dxvk/dxvk_pipecompiler.cpp index 51d653ef7..425fe7237 100644 --- a/src/dxvk/dxvk_pipecompiler.cpp +++ b/src/dxvk/dxvk_pipecompiler.cpp @@ -9,14 +9,14 @@ namespace dxvk { 1u, std::thread::hardware_concurrency() / 2); Logger::debug(str::format( - "DxvkPipelineCompiler: Using ", threadCount, " threads")); + "DxvkPipelineCompiler: Using ", threadCount, " workers")); // Start the compiler threads m_compilerThreads.resize(threadCount); for (uint32_t i = 0; i < threadCount; i++) { m_compilerThreads.at(i) = std::thread( - [this] { this->runCompilerThread(); }); + [this, i] { this->runCompilerThread(i); }); } } @@ -24,9 +24,9 @@ namespace dxvk { DxvkPipelineCompiler::~DxvkPipelineCompiler() { { std::unique_lock lock(m_compilerLock); m_compilerStop.store(true); - m_compilerCond.notify_all(); } + m_compilerCond.notify_all(); for (auto& thread : m_compilerThreads) thread.join(); } @@ -41,7 +41,10 @@ namespace dxvk { } - void DxvkPipelineCompiler::runCompilerThread() { + void DxvkPipelineCompiler::runCompilerThread(uint32_t workerId) { + Logger::debug(str::format( + "DxvkPipelineCompiler: Worker #", workerId, " started")); + while (!m_compilerStop.load()) { PipelineEntry entry; @@ -61,6 +64,9 @@ namespace dxvk { if (entry.pipeline != nullptr && entry.instance != nullptr) entry.pipeline->compileInstance(entry.instance); } + + Logger::debug(str::format( + "DxvkPipelineCompiler: Worker #", workerId, " stopped")); } } \ No newline at end of file diff --git a/src/dxvk/dxvk_pipecompiler.h b/src/dxvk/dxvk_pipecompiler.h index ca6cd9444..8312494dd 100644 --- a/src/dxvk/dxvk_pipecompiler.h +++ b/src/dxvk/dxvk_pipecompiler.h @@ -51,7 +51,7 @@ namespace dxvk { std::queue m_compilerQueue; std::vector m_compilerThreads; - void runCompilerThread(); + void runCompilerThread(uint32_t workerId); };