diff options
| author | 2018-08-05 16:37:39 -0400 | |
|---|---|---|
| committer | 2018-08-05 16:37:39 -0400 | |
| commit | c0af42d6eb7dbe7879f555aa9a415faee4c3d6d1 (patch) | |
| tree | 85469600d392a504b6de17b57b3e2f96e8cfb10b /src/core/core.cpp | |
| parent | Merge pull request #928 from MerryMage/dynarmic (diff) | |
| parent | renderer_base: Make Rasterizer() return the rasterizer by reference (diff) | |
| download | yuzu-c0af42d6eb7dbe7879f555aa9a415faee4c3d6d1.tar.gz yuzu-c0af42d6eb7dbe7879f555aa9a415faee4c3d6d1.tar.xz yuzu-c0af42d6eb7dbe7879f555aa9a415faee4c3d6d1.zip | |
Merge pull request #912 from lioncash/global-var
video_core: Eliminate the g_renderer global variable
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index e51e66550..e01c45cdd 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "core/loader/loader.h" | 18 | #include "core/loader/loader.h" |
| 19 | #include "core/settings.h" | 19 | #include "core/settings.h" |
| 20 | #include "file_sys/vfs_real.h" | 20 | #include "file_sys/vfs_real.h" |
| 21 | #include "video_core/renderer_base.h" | ||
| 21 | #include "video_core/video_core.h" | 22 | #include "video_core/video_core.h" |
| 22 | 23 | ||
| 23 | namespace Core { | 24 | namespace Core { |
| @@ -178,7 +179,6 @@ System::ResultStatus System::Init(EmuWindow& emu_window) { | |||
| 178 | cpu_cores[index] = std::make_shared<Cpu>(cpu_exclusive_monitor, cpu_barrier, index); | 179 | cpu_cores[index] = std::make_shared<Cpu>(cpu_exclusive_monitor, cpu_barrier, index); |
| 179 | } | 180 | } |
| 180 | 181 | ||
| 181 | gpu_core = std::make_unique<Tegra::GPU>(); | ||
| 182 | telemetry_session = std::make_unique<Core::TelemetrySession>(); | 182 | telemetry_session = std::make_unique<Core::TelemetrySession>(); |
| 183 | service_manager = std::make_shared<Service::SM::ServiceManager>(); | 183 | service_manager = std::make_shared<Service::SM::ServiceManager>(); |
| 184 | 184 | ||
| @@ -186,10 +186,13 @@ System::ResultStatus System::Init(EmuWindow& emu_window) { | |||
| 186 | Service::Init(service_manager); | 186 | Service::Init(service_manager); |
| 187 | GDBStub::Init(); | 187 | GDBStub::Init(); |
| 188 | 188 | ||
| 189 | if (!VideoCore::Init(emu_window)) { | 189 | renderer = VideoCore::CreateRenderer(emu_window); |
| 190 | if (!renderer->Init()) { | ||
| 190 | return ResultStatus::ErrorVideoCore; | 191 | return ResultStatus::ErrorVideoCore; |
| 191 | } | 192 | } |
| 192 | 193 | ||
| 194 | gpu_core = std::make_unique<Tegra::GPU>(renderer->Rasterizer()); | ||
| 195 | |||
| 193 | // Create threads for CPU cores 1-3, and build thread_to_cpu map | 196 | // Create threads for CPU cores 1-3, and build thread_to_cpu map |
| 194 | // CPU core 0 is run on the main thread | 197 | // CPU core 0 is run on the main thread |
| 195 | thread_to_cpu[std::this_thread::get_id()] = cpu_cores[0]; | 198 | thread_to_cpu[std::this_thread::get_id()] = cpu_cores[0]; |
| @@ -221,7 +224,7 @@ void System::Shutdown() { | |||
| 221 | perf_results.frametime * 1000.0); | 224 | perf_results.frametime * 1000.0); |
| 222 | 225 | ||
| 223 | // Shutdown emulation session | 226 | // Shutdown emulation session |
| 224 | VideoCore::Shutdown(); | 227 | renderer.reset(); |
| 225 | GDBStub::Shutdown(); | 228 | GDBStub::Shutdown(); |
| 226 | Service::Shutdown(); | 229 | Service::Shutdown(); |
| 227 | Kernel::Shutdown(); | 230 | Kernel::Shutdown(); |