summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWmain.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-02-09 19:59:16 +1300
committerGitHub <noreply@github.com>2023-02-09 19:59:16 +1300
commitccf92a3e56764d6378c436a8040519a5bffc3372 (patch)
treee2b330b225044e1901e77a6ed147cf21b9d7ac0e /Source/Core/VideoBackends/Software/SWmain.cpp
parent72b22ef0a54f841b1c52d49cf0e00d3b12c29ac7 (diff)
parent5c1b3ac61d7e660a9d1c206dbd0e615d637d3272 (diff)
Merge pull request #11522 from phire/KillRendererWithFire
Kill Renderer (with phire)
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp39
1 files changed, 7 insertions, 32 deletions
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index b6d2005c26..8703ea4b4d 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -16,6 +16,8 @@
#include "VideoBackends/Software/Clipper.h"
#include "VideoBackends/Software/EfbInterface.h"
#include "VideoBackends/Software/Rasterizer.h"
+#include "VideoBackends/Software/SWBoundingBox.h"
+#include "VideoBackends/Software/SWGfx.h"
#include "VideoBackends/Software/SWOGLWindow.h"
#include "VideoBackends/Software/SWRenderer.h"
#include "VideoBackends/Software/SWTexture.h"
@@ -23,6 +25,7 @@
#include "VideoBackends/Software/TextureCache.h"
#include "VideoCommon/FramebufferManager.h"
+#include "VideoCommon/Present.h"
#include "VideoCommon/TextureCacheBase.h"
#include "VideoCommon/VideoCommon.h"
#include "VideoCommon/VideoConfig.h"
@@ -96,8 +99,6 @@ void VideoSoftware::InitBackendInfo()
bool VideoSoftware::Initialize(const WindowSystemInfo& wsi)
{
- InitializeShared();
-
std::unique_ptr<SWOGLWindow> window = SWOGLWindow::Create(wsi);
if (!window)
return false;
@@ -105,40 +106,14 @@ bool VideoSoftware::Initialize(const WindowSystemInfo& wsi)
Clipper::Init();
Rasterizer::Init();
- g_renderer = std::make_unique<SWRenderer>(std::move(window));
- g_vertex_manager = std::make_unique<SWVertexLoader>();
- g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
- g_framebuffer_manager = std::make_unique<FramebufferManager>();
- g_perf_query = std::make_unique<PerfQuery>();
- g_texture_cache = std::make_unique<TextureCache>();
-
- if (!g_vertex_manager->Initialize() || !g_shader_cache->Initialize() ||
- !g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
- !g_texture_cache->Initialize())
- {
- PanicAlertFmt("Failed to initialize renderer classes");
- Shutdown();
- return false;
- }
-
- g_shader_cache->InitializeShaderCache();
- return true;
+ return InitializeShared(std::make_unique<SWGfx>(std::move(window)),
+ std::make_unique<SWVertexLoader>(), std::make_unique<PerfQuery>(),
+ std::make_unique<SWBoundingBox>(), std::make_unique<SWRenderer>(),
+ std::make_unique<TextureCache>());
}
void VideoSoftware::Shutdown()
{
- if (g_shader_cache)
- g_shader_cache->Shutdown();
-
- if (g_renderer)
- g_renderer->Shutdown();
-
- g_texture_cache.reset();
- g_perf_query.reset();
- g_framebuffer_manager.reset();
- g_shader_cache.reset();
- g_vertex_manager.reset();
- g_renderer.reset();
ShutdownShared();
}
} // namespace SW