summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-04-09 14:02:00 -0400
committerGravatar Lioncash2019-04-11 22:11:40 -0400
commit6d0551196d90af7f1233c655fd3b979811a14708 (patch)
tree9e91a2a79d5351360efaca57cc49be7801c7faf3 /src/core/core.cpp
parentcore/cpu_core_manager: Create threads separately from initialization. (diff)
downloadyuzu-6d0551196d90af7f1233c655fd3b979811a14708.tar.gz
yuzu-6d0551196d90af7f1233c655fd3b979811a14708.tar.xz
yuzu-6d0551196d90af7f1233c655fd3b979811a14708.zip
video_core/gpu: Create threads separately from initialization
Like with CPU emulation, we generally don't want to fire off the threads immediately after the relevant classes are initialized, we want to do this after all necessary data is done loading first. This splits the thread creation into its own interface member function to allow controlling when these threads in particular get created.
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 2b8ec3ca7..eb300eef7 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -3,9 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <array> 5#include <array>
6#include <map>
7#include <memory> 6#include <memory>
8#include <thread>
9#include <utility> 7#include <utility>
10 8
11#include "common/file_util.h" 9#include "common/file_util.h"
@@ -38,8 +36,6 @@
38#include "frontend/applets/software_keyboard.h" 36#include "frontend/applets/software_keyboard.h"
39#include "frontend/applets/web_browser.h" 37#include "frontend/applets/web_browser.h"
40#include "video_core/debug_utils/debug_utils.h" 38#include "video_core/debug_utils/debug_utils.h"
41#include "video_core/gpu_asynch.h"
42#include "video_core/gpu_synch.h"
43#include "video_core/renderer_base.h" 39#include "video_core/renderer_base.h"
44#include "video_core/video_core.h" 40#include "video_core/video_core.h"
45 41
@@ -135,13 +131,9 @@ struct System::Impl {
135 return ResultStatus::ErrorVideoCore; 131 return ResultStatus::ErrorVideoCore;
136 } 132 }
137 133
138 is_powered_on = true; 134 gpu_core = VideoCore::CreateGPU(system);
139 135
140 if (Settings::values.use_asynchronous_gpu_emulation) { 136 is_powered_on = true;
141 gpu_core = std::make_unique<VideoCommon::GPUAsynch>(system, *renderer);
142 } else {
143 gpu_core = std::make_unique<VideoCommon::GPUSynch>(system, *renderer);
144 }
145 137
146 LOG_DEBUG(Core, "Initialized OK"); 138 LOG_DEBUG(Core, "Initialized OK");
147 139
@@ -188,7 +180,8 @@ struct System::Impl {
188 } 180 }
189 181
190 // Main process has been loaded and been made current. 182 // Main process has been loaded and been made current.
191 // Begin CPU execution. 183 // Begin GPU and CPU execution.
184 gpu_core->Start();
192 cpu_core_manager.StartThreads(); 185 cpu_core_manager.StartThreads();
193 186
194 status = ResultStatus::Success; 187 status = ResultStatus::Success;