diff options
author | Liam <byteslice@airmail.cc> | 2022-11-27 20:37:37 -0500 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-11-28 19:49:09 -0500 |
commit | 89dd7dc1802cc53e828cb71c1f3e2bc0879459ce (patch) | |
tree | 718f8fec3534b4fdb77405e347f86bcf37980363 /src/yuzu/bootmanager.cpp | |
parent | 6b64557ad62141d1ac5d42e88ba7a3ed0cc9884d (diff) |
video_core: add null backend
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index c934069dd..f140e951f 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -237,8 +237,7 @@ private: GRenderWindow* render_window; }; -class OpenGLRenderWidget : public RenderWidget { -public: +struct OpenGLRenderWidget : public RenderWidget { explicit OpenGLRenderWidget(GRenderWindow* parent) : RenderWidget(parent) { windowHandle()->setSurfaceType(QWindow::OpenGLSurface); } @@ -251,13 +250,16 @@ private: std::unique_ptr<Core::Frontend::GraphicsContext> context; }; -class VulkanRenderWidget : public RenderWidget { -public: +struct VulkanRenderWidget : public RenderWidget { explicit VulkanRenderWidget(GRenderWindow* parent) : RenderWidget(parent) { windowHandle()->setSurfaceType(QWindow::VulkanSurface); } }; +struct NullRenderWidget : public RenderWidget { + explicit NullRenderWidget(GRenderWindow* parent) : RenderWidget(parent) {} +}; + static Core::Frontend::WindowSystemType GetWindowSystemType() { // Determine WSI type based on Qt platform. QString platform_name = QGuiApplication::platformName(); @@ -874,6 +876,9 @@ bool GRenderWindow::InitRenderTarget() { return false; } break; + case Settings::RendererBackend::Null: + InitializeNull(); + break; } // Update the Window System information with the new render target @@ -970,6 +975,11 @@ bool GRenderWindow::InitializeVulkan() { return true; } +void GRenderWindow::InitializeNull() { + child_widget = new NullRenderWidget(this); + main_context = std::make_unique<DummyContext>(); +} + bool GRenderWindow::LoadOpenGL() { auto context = CreateSharedContext(); auto scope = context->Acquire(); |