diff options
| author | Stenzek <stenzek@gmail.com> | 2017-07-27 13:15:38 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-07-30 17:43:59 +1000 |
| commit | c8f31656cb1c5f5e3c83a5b977fd822e987cb596 (patch) | |
| tree | 533941c3211604f5550bffb9b56930c141efd6ae /Source/Core/VideoBackends/Vulkan/ShaderCache.cpp | |
| parent | e17efb1d8dcff32e7db915a53dc95df0bf329692 (diff) | |
VideoBackends: Support a different number of threads for precompiling
At runtime, we only really want a single shader compiler thread.
However, for initial boots, we can use a higher number to speed things
up.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ShaderCache.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp b/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp index 07b71a6202..7d5c3e2379 100644 --- a/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp @@ -63,9 +63,9 @@ bool ShaderCache::Initialize() return false; m_async_shader_compiler = std::make_unique<VideoCommon::AsyncShaderCompiler>(); - if (g_ActiveConfig.GetShaderCompilerThreads() > 0) - m_async_shader_compiler->StartWorkerThreads(g_ActiveConfig.GetShaderCompilerThreads()); - + m_async_shader_compiler->ResizeWorkerThreads(g_ActiveConfig.CanPrecompileUberShaders() ? + g_ActiveConfig.GetShaderPrecompilerThreads() : + g_ActiveConfig.GetShaderCompilerThreads()); return true; } @@ -1236,6 +1236,9 @@ void ShaderCache::PrecompileUberShaders() }); WaitForBackgroundCompilesToComplete(); + + // Switch to the runtime/background thread config. + m_async_shader_compiler->ResizeWorkerThreads(g_ActiveConfig.GetShaderCompilerThreads()); } void ShaderCache::WaitForBackgroundCompilesToComplete() |
