mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
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.
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user