From dcad3ec892f02a703eb732c5679125291e7f0033 Mon Sep 17 00:00:00 2001 From: Silent Date: Sun, 10 Nov 2019 21:52:52 +0100 Subject: Allow to interrupt shader precompilation by stopping emulation --- Source/Core/VideoCommon/ShaderCache.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoCommon/ShaderCache.cpp') 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; -- cgit v1.2.3