summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D12/main.cpp
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2016-01-13 21:14:20 +0100
committerdegasus <wickmarkus@web.de>2016-06-26 12:34:59 +0200
commit7833ff25df5cb3bf10b363d30d7af8007094454a (patch)
tree0ee31e872c3b5ac1951e72bb54266e3e5e672306 /Source/Core/VideoBackends/D3D12/main.cpp
parentb16333a25cc0d8396f71fa1e410484026adea964 (diff)
VideoBackends: Merge Initialize and Shutdown functions.
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/main.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D12/main.cpp92
1 files changed, 29 insertions, 63 deletions
diff --git a/Source/Core/VideoBackends/D3D12/main.cpp b/Source/Core/VideoBackends/D3D12/main.cpp
index c0be65c7c4..5fc1658c9f 100644
--- a/Source/Core/VideoBackends/D3D12/main.cpp
+++ b/Source/Core/VideoBackends/D3D12/main.cpp
@@ -62,6 +62,11 @@ std::string VideoBackend::GetDisplayName() const
return "Direct3D 12 (experimental)";
}
+std::string VideoBackend::GetConfigName() const
+{
+ return "gfx_dx12";
+}
+
void InitBackendInfo()
{
HRESULT hr = D3D::LoadDXGI();
@@ -155,7 +160,7 @@ void InitBackendInfo()
void VideoBackend::ShowConfig(void* hParent)
{
InitBackendInfo();
- Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_dx12");
+ Host_ShowVideoConfig(hParent, GetDisplayName(), GetConfigName());
}
bool VideoBackend::Initialize(void* window_handle)
@@ -163,26 +168,13 @@ 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_dx12.ini");
-
- g_Config.GameIniLoad();
- g_Config.UpdateProjectionHack();
- g_Config.VerifyValidity();
- UpdateActiveConfig();
+ InitializeShared();
if (FAILED(D3D::Create((HWND)window_handle)))
return false;
m_window_handle = window_handle;
- m_initialized = true;
return true;
}
@@ -200,62 +192,36 @@ void VideoBackend::Video_Prepare()
StaticShaderCache::Init();
StateCache::Init(); // PSO cache is populated here, after constituent shaders are loaded.
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 = true;
-
// TODO: should be in Video_Cleanup
- if (g_renderer)
- {
- // Immediately stop app from submitting work to GPU, and wait for all submitted work to
- // complete. D3D12TODO: Check this.
- D3D::command_list_mgr->ExecuteQueuedWork(true);
-
- // VideoCommon
- Fifo::Shutdown();
- CommandProcessor::Shutdown();
- GeometryShaderManager::Shutdown();
- PixelShaderManager::Shutdown();
- VertexShaderManager::Shutdown();
- OpcodeDecoder::Shutdown();
- VertexLoaderManager::Shutdown();
-
- // internal interfaces
- D3D::ShutdownUtils();
- ShaderCache::Shutdown();
- ShaderConstantsManager::Shutdown();
- StaticShaderCache::Shutdown();
- BBox::Shutdown();
-
- g_xfb_encoder.reset();
- g_perf_query.reset();
- g_vertex_manager.reset();
- g_texture_cache.reset();
- g_renderer.reset();
-
- D3D::Close();
- }
+
+ // Immediately stop app from submitting work to GPU, and wait for all submitted work to complete.
+ // D3D12TODO: Check this.
+ D3D::command_list_mgr->ExecuteQueuedWork(true);
+
+ // internal interfaces
+ D3D::ShutdownUtils();
+ ShaderCache::Shutdown();
+ ShaderConstantsManager::Shutdown();
+ StaticShaderCache::Shutdown();
+ BBox::Shutdown();
+
+ g_xfb_encoder.reset();
+ g_perf_query.reset();
+ g_vertex_manager.reset();
+ g_texture_cache.reset();
+ g_renderer.reset();
+
+ D3D::Close();
+
+ ShutdownShared();
}
void VideoBackend::Video_Cleanup()
{
+ CleanupShared();
}
}