diff options
| author | Stenzek <stenzek@gmail.com> | 2018-03-01 19:21:06 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-03-10 16:11:19 +1000 |
| commit | e31cc1f679db82f6baca1bb3d934e2dd17542d55 (patch) | |
| tree | 0edb0e3947fd0f53c4e682ea102cec7297b5e8e0 /Source/Core/VideoCommon/VideoConfig.cpp | |
| parent | 9fa24700b69b98b2569f4bd1353482cbfb1ec2d7 (diff) | |
ShaderCache: Implement background shader compilation
This enables shaders to be compiled while the game is starting, instead
of blocking startup. If a shader is needed before it is compiled,
emulation will block.
Diffstat (limited to 'Source/Core/VideoCommon/VideoConfig.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VideoConfig.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index c14a00757a..271223ba3d 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -102,6 +102,7 @@ void VideoConfig::Refresh() bBackendMultithreading = Config::Get(Config::GFX_BACKEND_MULTITHREADING); iCommandBufferExecuteInterval = Config::Get(Config::GFX_COMMAND_BUFFER_EXECUTE_INTERVAL); bShaderCache = Config::Get(Config::GFX_SHADER_CACHE); + bWaitForShadersBeforeStarting = Config::Get(Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING); iUberShaderMode = static_cast<UberShaderMode>(Config::Get(Config::GFX_UBERSHADER_MODE)); iShaderCompilerThreads = Config::Get(Config::GFX_SHADER_COMPILER_THREADS); iShaderPrecompilerThreads = Config::Get(Config::GFX_SHADER_PRECOMPILER_THREADS); @@ -196,6 +197,10 @@ u32 VideoConfig::GetShaderCompilerThreads() const u32 VideoConfig::GetShaderPrecompilerThreads() const { + // When using background compilation, always keep the same thread count. + if (bWaitForShadersBeforeStarting) + return GetShaderCompilerThreads(); + if (!backend_info.bSupportsBackgroundCompiling) return 0; |
