summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends/D3D/main.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/main.cpp77
1 files changed, 15 insertions, 62 deletions
diff --git a/Source/Core/VideoBackends/D3D/main.cpp b/Source/Core/VideoBackends/D3D/main.cpp
index 8fd9989a92..e630c177f9 100644
--- a/Source/Core/VideoBackends/D3D/main.cpp
+++ b/Source/Core/VideoBackends/D3D/main.cpp
@@ -61,7 +61,7 @@ std::string VideoBackend::GetDisplayName() const
return "Direct3D 11";
}
-void InitBackendInfo()
+void VideoBackend::InitBackendInfo()
{
HRESULT hr = DX11::D3D::LoadDXGI();
if (SUCCEEDED(hr))
@@ -138,34 +138,15 @@ void InitBackendInfo()
DX11::D3D::UnloadD3D();
}
-void VideoBackend::ShowConfig(void* hParent)
-{
- InitBackendInfo();
- Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_dx11");
-}
-
bool VideoBackend::Initialize(void* window_handle)
{
if (window_handle == nullptr)
return false;
- InitializeShared();
InitBackendInfo();
-
- frameCount = 0;
-
- if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini"))
- g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini");
- else
- g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "gfx_dx11.ini");
-
- g_Config.GameIniLoad();
- g_Config.UpdateProjectionHack();
- g_Config.VerifyValidity();
- UpdateActiveConfig();
+ InitializeShared();
m_window_handle = window_handle;
- m_initialized = true;
return true;
}
@@ -181,55 +162,27 @@ void VideoBackend::Video_Prepare()
PixelShaderCache::Init();
GeometryShaderCache::Init();
D3D::InitUtils();
-
- // VideoCommon
- BPInit();
- Fifo::Init();
- IndexGenerator::Init();
- VertexLoaderManager::Init();
- OpcodeDecoder::Init();
- VertexShaderManager::Init();
- PixelShaderManager::Init();
- GeometryShaderManager::Init();
- CommandProcessor::Init();
- PixelEngine::Init();
- BBox::Init();
-
- // Tell the host that the window is ready
- Host_Message(WM_USER_CREATE);
}
void VideoBackend::Shutdown()
{
- m_initialized = false;
-
// TODO: should be in Video_Cleanup
- if (g_renderer)
- {
- // VideoCommon
- Fifo::Shutdown();
- CommandProcessor::Shutdown();
- GeometryShaderManager::Shutdown();
- PixelShaderManager::Shutdown();
- VertexShaderManager::Shutdown();
- OpcodeDecoder::Shutdown();
- VertexLoaderManager::Shutdown();
-
- // internal interfaces
- D3D::ShutdownUtils();
- PixelShaderCache::Shutdown();
- VertexShaderCache::Shutdown();
- GeometryShaderCache::Shutdown();
- BBox::Shutdown();
-
- g_perf_query.reset();
- g_vertex_manager.reset();
- g_texture_cache.reset();
- g_renderer.reset();
- }
+ D3D::ShutdownUtils();
+ PixelShaderCache::Shutdown();
+ VertexShaderCache::Shutdown();
+ GeometryShaderCache::Shutdown();
+ BBox::Shutdown();
+
+ g_perf_query.reset();
+ g_vertex_manager.reset();
+ g_texture_cache.reset();
+ g_renderer.reset();
+
+ ShutdownShared();
}
void VideoBackend::Video_Cleanup()
{
+ CleanupShared();
}
}