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.h | |
| 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.h')
| -rw-r--r-- | src/core/core.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/core.h b/src/core/core.h index 4c9967559..a3be88aa8 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -27,6 +27,10 @@ namespace Service::SM { | |||
| 27 | class ServiceManager; | 27 | class ServiceManager; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | namespace VideoCore { | ||
| 31 | class RendererBase; | ||
| 32 | } | ||
| 33 | |||
| 30 | namespace Core { | 34 | namespace Core { |
| 31 | 35 | ||
| 32 | class System { | 36 | class System { |
| @@ -129,11 +133,26 @@ public: | |||
| 129 | /// Gets a CPU interface to the CPU core with the specified index | 133 | /// Gets a CPU interface to the CPU core with the specified index |
| 130 | Cpu& CpuCore(size_t core_index); | 134 | Cpu& CpuCore(size_t core_index); |
| 131 | 135 | ||
| 132 | /// Gets the GPU interface | 136 | /// Gets a mutable reference to the GPU interface |
| 133 | Tegra::GPU& GPU() { | 137 | Tegra::GPU& GPU() { |
| 134 | return *gpu_core; | 138 | return *gpu_core; |
| 135 | } | 139 | } |
| 136 | 140 | ||
| 141 | /// Gets an immutable reference to the GPU interface. | ||
| 142 | const Tegra::GPU& GPU() const { | ||
| 143 | return *gpu_core; | ||
| 144 | } | ||
| 145 | |||
| 146 | /// Gets a mutable reference to the renderer. | ||
| 147 | VideoCore::RendererBase& Renderer() { | ||
| 148 | return *renderer; | ||
| 149 | } | ||
| 150 | |||
| 151 | /// Gets an immutable reference to the renderer. | ||
| 152 | const VideoCore::RendererBase& Renderer() const { | ||
| 153 | return *renderer; | ||
| 154 | } | ||
| 155 | |||
| 137 | /// Gets the scheduler for the CPU core that is currently running | 156 | /// Gets the scheduler for the CPU core that is currently running |
| 138 | Kernel::Scheduler& CurrentScheduler() { | 157 | Kernel::Scheduler& CurrentScheduler() { |
| 139 | return *CurrentCpuCore().Scheduler(); | 158 | return *CurrentCpuCore().Scheduler(); |
| @@ -197,6 +216,7 @@ private: | |||
| 197 | 216 | ||
| 198 | /// AppLoader used to load the current executing application | 217 | /// AppLoader used to load the current executing application |
| 199 | std::unique_ptr<Loader::AppLoader> app_loader; | 218 | std::unique_ptr<Loader::AppLoader> app_loader; |
| 219 | std::unique_ptr<VideoCore::RendererBase> renderer; | ||
| 200 | std::unique_ptr<Tegra::GPU> gpu_core; | 220 | std::unique_ptr<Tegra::GPU> gpu_core; |
| 201 | std::shared_ptr<Tegra::DebugContext> debug_context; | 221 | std::shared_ptr<Tegra::DebugContext> debug_context; |
| 202 | Kernel::SharedPtr<Kernel::Process> current_process; | 222 | Kernel::SharedPtr<Kernel::Process> current_process; |