summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWmain.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2016-06-26 12:48:59 +0200
committerGitHub <noreply@github.com>2016-06-26 12:48:59 +0200
commit3887328bbaf43320b22ef2ca4ade325c23789d0f (patch)
tree4b3501c75657ecca47e85e3aa3fd4361641b78a3 /Source/Core/VideoBackends/Software/SWmain.cpp
parentb16333a25cc0d8396f71fa1e410484026adea964 (diff)
parentd79aeaa1e9b224b3bb147c605fb8ffd6e2bfc890 (diff)
Merge pull request #3510 from degasus/master
VideoBackends: Merge backend initialization and shutdown.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWmain.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp75
1 files changed, 16 insertions, 59 deletions
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 083e9766e7..d34395570d 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -134,7 +134,7 @@ std::string VideoSoftware::GetDisplayName() const
return "Software Renderer";
}
-static void InitBackendInfo()
+void VideoSoftware::InitBackendInfo()
{
g_Config.backend_info.APIType = API_NONE;
g_Config.backend_info.bSupports3DVision = false;
@@ -147,23 +147,10 @@ static void InitBackendInfo()
g_Config.backend_info.AAModes = {1};
}
-void VideoSoftware::ShowConfig(void* hParent)
-{
- if (!m_initialized)
- InitBackendInfo();
- Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_software");
-}
-
bool VideoSoftware::Initialize(void* window_handle)
{
- InitializeShared();
InitBackendInfo();
-
- g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
- g_Config.GameIniLoad();
- g_Config.UpdateProjectionHack();
- g_Config.VerifyValidity();
- UpdateActiveConfig();
+ InitializeShared();
SWOGLWindow::Init(window_handle);
@@ -173,71 +160,41 @@ bool VideoSoftware::Initialize(void* window_handle)
SWRenderer::Init();
DebugUtil::Init();
- // Do our OSD callbacks
- OSD::DoCallbacks(OSD::CallbackType::Initialization);
-
- m_initialized = true;
-
return true;
}
void VideoSoftware::Shutdown()
{
- m_initialized = false;
-
- // Do our OSD callbacks
- OSD::DoCallbacks(OSD::CallbackType::Shutdown);
-
SWOGLWindow::Shutdown();
+
+ ShutdownShared();
}
void VideoSoftware::Video_Cleanup()
{
- if (g_renderer)
- {
- Fifo::Shutdown();
- SWRenderer::Shutdown();
- DebugUtil::Shutdown();
- // The following calls are NOT Thread Safe
- // And need to be called from the video thread
- SWRenderer::Shutdown();
- VertexLoaderManager::Shutdown();
- g_framebuffer_manager.reset();
- g_texture_cache.reset();
- VertexShaderManager::Shutdown();
- PixelShaderManager::Shutdown();
- g_perf_query.reset();
- g_vertex_manager.reset();
- OpcodeDecoder::Shutdown();
- g_renderer.reset();
- }
+ CleanupShared();
+
+ SWRenderer::Shutdown();
+ DebugUtil::Shutdown();
+ // The following calls are NOT Thread Safe
+ // And need to be called from the video thread
+ SWRenderer::Shutdown();
+ g_framebuffer_manager.reset();
+ g_texture_cache.reset();
+ g_perf_query.reset();
+ g_vertex_manager.reset();
+ g_renderer.reset();
}
// This is called after Video_Initialize() from the Core
void VideoSoftware::Video_Prepare()
{
g_renderer = std::make_unique<SWRenderer>();
-
- CommandProcessor::Init();
- PixelEngine::Init();
-
- BPInit();
g_vertex_manager = std::make_unique<SWVertexLoader>();
g_perf_query = std::make_unique<PerfQuery>();
- Fifo::Init(); // must be done before OpcodeDecoder::Init()
- OpcodeDecoder::Init();
- IndexGenerator::Init();
- VertexShaderManager::Init();
- PixelShaderManager::Init();
g_texture_cache = std::make_unique<TextureCache>();
SWRenderer::Init();
- VertexLoaderManager::Init();
g_framebuffer_manager = std::make_unique<FramebufferManager>();
-
- // Notify the core that the video backend is ready
- Host_Message(WM_USER_CREATE);
-
- INFO_LOG(VIDEO, "Video backend initialized.");
}
unsigned int VideoSoftware::PeekMessages()