summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/ShaderCache.cpp
diff options
context:
space:
mode:
authorSilent <zdanio95@gmail.com>2019-11-10 21:52:52 +0100
committerSilent <zdanio95@gmail.com>2022-06-10 17:11:32 +0200
commitdcad3ec892f02a703eb732c5679125291e7f0033 (patch)
tree9e35872ae6b673c46c1ab65a07e0f04566787423 /Source/Core/VideoCommon/ShaderCache.cpp
parentaad42de6c9cc1f46b9febf6962378b15b77ad450 (diff)
Allow to interrupt shader precompilation by stopping emulation
Diffstat (limited to 'Source/Core/VideoCommon/ShaderCache.cpp')
-rw-r--r--Source/Core/VideoCommon/ShaderCache.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/ShaderCache.cpp b/Source/Core/VideoCommon/ShaderCache.cpp
index 984793d9d8..b5d848238a 100644
--- a/Source/Core/VideoCommon/ShaderCache.cpp
+++ b/Source/Core/VideoCommon/ShaderCache.cpp
@@ -157,9 +157,12 @@ const AbstractPipeline* ShaderCache::GetUberPipelineForUid(const GXUberPipelineU
void ShaderCache::WaitForAsyncCompiler()
{
- while (m_async_shader_compiler->HasPendingWork() || m_async_shader_compiler->HasCompletedWork())
+ bool running = true;
+
+ while (running &&
+ (m_async_shader_compiler->HasPendingWork() || m_async_shader_compiler->HasCompletedWork()))
{
- m_async_shader_compiler->WaitUntilCompletion([](size_t completed, size_t total) {
+ running = m_async_shader_compiler->WaitUntilCompletion([](size_t completed, size_t total) {
g_renderer->BeginUIFrame();
const float center_x = ImGui::GetIO().DisplaySize.x * 0.5f;