video_core: Initialize renderer with a GPU

Add an extra step in GPU initialization to be able to initialize render
backends with a valid GPU instance.
This commit is contained in:
ReinUsesLisp
2020-06-11 00:58:57 -03:00
parent ada9b7fb77
commit da53bcee60
22 changed files with 172 additions and 119 deletions

View File

@ -237,8 +237,10 @@ std::string BuildCommaSeparatedExtensions(std::vector<std::string> available_ext
} // Anonymous namespace
RendererVulkan::RendererVulkan(Core::Frontend::EmuWindow& window, Core::System& system)
: RendererBase(window), system{system} {}
RendererVulkan::RendererVulkan(Core::System& system_, Core::Frontend::EmuWindow& emu_window,
Tegra::GPU& gpu_,
std::unique_ptr<Core::Frontend::GraphicsContext> context)
: RendererBase{emu_window, std::move(context)}, system{system_}, gpu{gpu_} {}
RendererVulkan::~RendererVulkan() {
ShutDown();

View File

@ -38,7 +38,9 @@ struct VKScreenInfo {
class RendererVulkan final : public VideoCore::RendererBase {
public:
explicit RendererVulkan(Core::Frontend::EmuWindow& window, Core::System& system);
explicit RendererVulkan(Core::System& system, Core::Frontend::EmuWindow& emu_window,
Tegra::GPU& gpu,
std::unique_ptr<Core::Frontend::GraphicsContext> context);
~RendererVulkan() override;
bool Init() override;
@ -58,6 +60,7 @@ private:
void Report() const;
Core::System& system;
Tegra::GPU& gpu;
Common::DynamicLibrary library;
vk::InstanceDispatch dld;