diff options
| author | Stenzek <stenzek@gmail.com> | 2018-03-11 14:24:45 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2018-03-15 01:50:47 +1000 |
| commit | 517a9774442d39b641e4a893a6734994dfe0074d (patch) | |
| tree | 7257cba70f803d0aa4a95ba31350bbabeb993cf6 /Source/Core/VideoCommon/AsyncShaderCompiler.cpp | |
| parent | 6813c5e1e946fda239d1769a3893099357c5274c (diff) | |
ShaderCache: Fix several issues in background shader compiling
- In D3D, shaders could be compiled on the main thread, blocking
startup.
- Reduced the latency between a pipeline being requested and used in all
backends in hybrid ubershader mode, when no shader stages were present.
- Fixed a case where async compilation could cause the same UID to be
appended multiple times to the UID cache.
- Fix incorrect number of threads being used when immediately compile
shaders was enabled.
Diffstat (limited to 'Source/Core/VideoCommon/AsyncShaderCompiler.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/AsyncShaderCompiler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp index e605828ed5..2f14c1621b 100644 --- a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp +++ b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp @@ -57,6 +57,12 @@ bool AsyncShaderCompiler::HasPendingWork() return !m_pending_work.empty() || m_busy_workers.load() != 0; } +bool AsyncShaderCompiler::HasCompletedWork() +{ + std::lock_guard<std::mutex> guard(m_completed_work_lock); + return !m_completed_work.empty(); +} + void AsyncShaderCompiler::WaitUntilCompletion() { while (HasPendingWork()) |
