aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-11-27 20:37:37 -0500
committerLiam <byteslice@airmail.cc>2022-11-28 19:49:09 -0500
commitacc4a150efde504be135f02de66552c9c5b55271 (patch)
tree718f8fec3534b4fdb77405e347f86bcf37980363 /src/yuzu/bootmanager.cpp
parent48b545354a176a15986abdf5c50cb0ed08ea3d8c (diff)
video_core: add null backend
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index c934069dd9..f140e951f8 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();