summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/AsyncShaderCompiler.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2025-02-06 18:31:28 +0100
committerGitHub <noreply@github.com>2025-02-06 18:31:28 +0100
commitdb285b7c877b37d7388756f38bdd75332232cff6 (patch)
treec272c0a8316a2ce480669851c67517511ff64e3a /Source/Core/VideoCommon/AsyncShaderCompiler.cpp
parent6ee08fb9db58a8c05143673c8b5f2afd543c0181 (diff)
parent7dec083af5ebb99d1a3269b5f523b55bfe939d51 (diff)
Merge pull request #13319 from hoogmin/infinite-style-fix
Refactor: Infinite loop in AsyncShaderCompiler according to style guidelines
Diffstat (limited to 'Source/Core/VideoCommon/AsyncShaderCompiler.cpp')
-rw-r--r--Source/Core/VideoCommon/AsyncShaderCompiler.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp
index ca59ee6330..c69354628d 100644
--- a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp
+++ b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp
@@ -95,23 +95,20 @@ bool AsyncShaderCompiler::WaitUntilCompletion(
}
// Update progress while the compiles complete.
- for (;;)
+ while (Core::GetState(Core::System::GetInstance()) != Core::State::Stopping)
{
- if (Core::GetState(Core::System::GetInstance()) == Core::State::Stopping)
- return false;
-
size_t remaining_items;
{
std::lock_guard<std::mutex> pending_guard(m_pending_work_lock);
if (m_pending_work.empty() && !m_busy_workers.load())
- break;
+ return true;
remaining_items = m_pending_work.size();
}
progress_callback(total_items - remaining_items, total_items);
std::this_thread::sleep_for(CHECK_INTERVAL);
}
- return true;
+ return false;
}
bool AsyncShaderCompiler::StartWorkerThreads(u32 num_worker_threads)