diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-05 16:37:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-05 16:37:39 -0400 |
commit | c0af42d6eb7dbe7879f555aa9a415faee4c3d6d1 (patch) | |
tree | 85469600d392a504b6de17b57b3e2f96e8cfb10b /src/core/core.h | |
parent | e06953626cdf7da5855f0fceafc2643bad490a7b (diff) | |
parent | 2665457f4ab3562525543f8e474bfb93ce3416ad (diff) |
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 { class ServiceManager; } +namespace VideoCore { +class RendererBase; +} + namespace Core { class System { @@ -129,11 +133,26 @@ public: /// Gets a CPU interface to the CPU core with the specified index Cpu& CpuCore(size_t core_index); - /// Gets the GPU interface + /// Gets a mutable reference to the GPU interface Tegra::GPU& GPU() { return *gpu_core; } + /// Gets an immutable reference to the GPU interface. + const Tegra::GPU& GPU() const { + return *gpu_core; + } + + /// Gets a mutable reference to the renderer. + VideoCore::RendererBase& Renderer() { + return *renderer; + } + + /// Gets an immutable reference to the renderer. + const VideoCore::RendererBase& Renderer() const { + return *renderer; + } + /// Gets the scheduler for the CPU core that is currently running Kernel::Scheduler& CurrentScheduler() { return *CurrentCpuCore().Scheduler(); @@ -197,6 +216,7 @@ private: /// AppLoader used to load the current executing application std::unique_ptr<Loader::AppLoader> app_loader; + std::unique_ptr<VideoCore::RendererBase> renderer; std::unique_ptr<Tegra::GPU> gpu_core; std::shared_ptr<Tegra::DebugContext> debug_context; Kernel::SharedPtr<Kernel::Process> current_process; |