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.
This commit is contained in:
Stenzek committed 2018-03-15 01:50:47 +10:00
1 parent 6813c5e1e9
commit 517a977444
5 files changed
+104 -112

No files matched your search

@@ -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())