Debian Codegraph @

Source/Core/VideoCommon/AsyncRequests.cpp

raw symbols SCIP
1 // Copyright 2015 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #include "VideoCommon/AsyncRequests.h"
5
6 #include "Core/System.h"
7
8 #include "VideoCommon/Fifo.h"
9 #include "VideoCommon/VertexManagerBase.h"
10 #include "VideoCommon/VideoBackendBase.h"
11 #include "VideoCommon/VideoEvents.h"
12
13 AsyncRequests AsyncRequests::s_singleton;
14
15 AsyncRequests::AsyncRequests() = default;
16
17 void AsyncRequests::PullEvents()
18 {
19 if (m_queue.Empty())
20 return;
21
22 // This is only called if the queue isn't empty.
23 // So just flush the pipeline to get accurate results.
24 g_vertex_manager->Flush();
25
26 while (!m_queue.Empty())
27 {
28 std::invoke(std::move(m_queue.Front()));
29 m_queue.Pop();
30 }
31 }
32
33 void AsyncRequests::QueueEvent(Event&& event)
34 {
35 m_queue.Push(std::move(event));
36
37 auto& system = Core::System::GetInstance();
38 system.GetFifo().RunGpu();
39 }
40
41 void AsyncRequests::WaitForEmptyQueue()
42 {
43 m_queue.WaitForEmpty();
44 }
45
46 void AsyncRequests::SetPassthrough(bool enable)
47 {
48 m_passthrough = enable;
49 }