Add GetRenderer to core

This commit is contained in:
James Rowe 2019-09-07 16:13:10 -06:00
parent be52d3a7d0
commit d03d201482
3 changed files with 21 additions and 5 deletions

View file

@ -198,8 +198,8 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo
timing = std::make_unique<Timing>();
kernel = std::make_unique<Kernel::KernelSystem>(*memory, *timing,
[this] { PrepareReschedule(); }, system_mode);
kernel = std::make_unique<Kernel::KernelSystem>(
*memory, *timing, [this] { PrepareReschedule(); }, system_mode);
if (Settings::values.use_cpu_jit) {
#ifdef ARCHITECTURE_x86_64
@ -237,9 +237,16 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo
Service::Init(*this);
GDBStub::Init();
ResultStatus result = VideoCore::Init(emu_window, *memory);
if (result != ResultStatus::Success) {
return result;
VideoCore::ResultStatus result = VideoCore::Init(emu_window, *memory);
if (result != VideoCore::ResultStatus::Success) {
switch (result) {
case VideoCore::ResultStatus::ErrorGenericDrivers:
return ResultStatus::ErrorVideoCore_ErrorGenericDrivers;
case VideoCore::ResultStatus::ErrorBelowGL33:
return ResultStatus::ErrorVideoCore_ErrorBelowGL33;
default:
return ResultStatus::ErrorVideoCore;
}
}
#ifdef ENABLE_FFMPEG_VIDEO_DUMPER
@ -253,6 +260,10 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo
return ResultStatus::Success;
}
RendererBase& System::Renderer() {
return *VideoCore::g_renderer;
}
Service::SM::ServiceManager& System::ServiceManager() {
return *service_manager;
}

View file

@ -55,6 +55,8 @@ namespace VideoDumper {
class Backend;
}
class RendererBase;
namespace Core {
class Timing;
@ -170,6 +172,8 @@ public:
return *dsp_core;
}
RendererBase& Renderer();
/**
* Gets a reference to the service manager.
* @returns A reference to the service manager.

View file

@ -11,6 +11,7 @@
#include "common/logging/log.h"
#include "common/microprofile.h"
#include "common/vector_math.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "core/hle/service/gsp/gsp.h"
#include "core/hw/gpu.h"