Merge pull request #9344 from liamwhite/null

video_core: add null backend
This commit is contained in:
bunnei
2022-12-03 11:23:25 -08:00
committed by GitHub
20 changed files with 383 additions and 28 deletions

View File

@ -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();
@ -878,6 +880,9 @@ bool GRenderWindow::InitRenderTarget() {
return false;
}
break;
case Settings::RendererBackend::Null:
InitializeNull();
break;
}
// Update the Window System information with the new render target
@ -974,6 +979,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();