summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-10-25 16:47:09 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2025-10-26 23:07:14 -0500
commit700abd68e3214d7586a1ea89b33dce9c9934bacf (patch)
treef02718bca7ec0f5f99839628e1b8083f478581d5 /Source
parent6416b0a6ec289bc1aba00ce5b8f0fa6bb59586d3 (diff)
VideoCommon/AsyncRequests: Remove now unnecessary `SetEnable` function. Requests are now always enabled. Call `SetPassthrough` on initialization to not be racy.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Core/Core.cpp2
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.cpp17
-rw-r--r--Source/Core/VideoCommon/AsyncRequests.h2
-rw-r--r--Source/Core/VideoCommon/Fifo.cpp6
4 files changed, 2 insertions, 25 deletions
diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp
index 781656529c..991f2f09df 100644
--- a/Source/Core/Core/Core.cpp
+++ b/Source/Core/Core/Core.cpp
@@ -457,6 +457,8 @@ static void FifoPlayerThread(Core::System& system, const std::optional<std::stri
const auto init_video = [&] {
DeclareAsGPUThread();
+ AsyncRequests::GetInstance()->SetPassthrough(!system.IsDualCoreMode());
+
// Must happen on the proper thread for some video backends, e.g. OpenGL.
return g_video_backend->Initialize(wsi);
};
diff --git a/Source/Core/VideoCommon/AsyncRequests.cpp b/Source/Core/VideoCommon/AsyncRequests.cpp
index 0469d3ebb9..6671f93293 100644
--- a/Source/Core/VideoCommon/AsyncRequests.cpp
+++ b/Source/Core/VideoCommon/AsyncRequests.cpp
@@ -42,9 +42,6 @@ void AsyncRequests::QueueEvent(Event&& event)
{
m_empty.Clear();
- if (!m_enable)
- return;
-
m_queue.push(std::move(event));
auto& system = Core::System::GetInstance();
@@ -57,20 +54,6 @@ void AsyncRequests::WaitForEmptyQueue()
m_cond.wait(lock, [this] { return m_queue.empty(); });
}
-void AsyncRequests::SetEnable(bool enable)
-{
- std::unique_lock<std::mutex> lock(m_mutex);
- m_enable = enable;
-
- if (!enable)
- {
- // flush the queue on disabling
- while (!m_queue.empty())
- m_queue.pop();
- m_cond.notify_one();
- }
-}
-
void AsyncRequests::SetPassthrough(bool enable)
{
std::unique_lock<std::mutex> lock(m_mutex);
diff --git a/Source/Core/VideoCommon/AsyncRequests.h b/Source/Core/VideoCommon/AsyncRequests.h
index 1c72b55b85..7b8cdd036b 100644
--- a/Source/Core/VideoCommon/AsyncRequests.h
+++ b/Source/Core/VideoCommon/AsyncRequests.h
@@ -26,7 +26,6 @@ public:
PullEventsInternal();
}
void WaitForEmptyQueue();
- void SetEnable(bool enable);
void SetPassthrough(bool enable);
template <typename F>
@@ -74,6 +73,5 @@ private:
std::mutex m_mutex;
std::condition_variable m_cond;
- bool m_enable = false;
bool m_passthrough = true;
};
diff --git a/Source/Core/VideoCommon/Fifo.cpp b/Source/Core/VideoCommon/Fifo.cpp
index 513b655408..0e7bb4c341 100644
--- a/Source/Core/VideoCommon/Fifo.cpp
+++ b/Source/Core/VideoCommon/Fifo.cpp
@@ -287,9 +287,6 @@ void FifoManager::ResetVideoBuffer()
// Purpose: Keep the Core HW updated about the CPU-GPU distance
void FifoManager::RunGpuLoop()
{
- AsyncRequests::GetInstance()->SetEnable(true);
- AsyncRequests::GetInstance()->SetPassthrough(false);
-
m_gpu_mainloop.Run(
[this] {
// Run events from the CPU thread.
@@ -391,9 +388,6 @@ void FifoManager::RunGpuLoop()
}
},
100);
-
- AsyncRequests::GetInstance()->SetEnable(false);
- AsyncRequests::GetInstance()->SetPassthrough(true);
}
void FifoManager::FlushGpu()