diff options
Diffstat (limited to 'Source/Core/VideoBackends/D3D12/main.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D12/main.cpp | 93 |
1 files changed, 24 insertions, 69 deletions
diff --git a/Source/Core/VideoBackends/D3D12/main.cpp b/Source/Core/VideoBackends/D3D12/main.cpp index c0be65c7c4..a593220c56 100644 --- a/Source/Core/VideoBackends/D3D12/main.cpp +++ b/Source/Core/VideoBackends/D3D12/main.cpp @@ -62,7 +62,7 @@ std::string VideoBackend::GetDisplayName() const return "Direct3D 12 (experimental)"; } -void InitBackendInfo() +void VideoBackend::InitBackendInfo() { HRESULT hr = D3D::LoadDXGI(); if (FAILED(hr)) @@ -152,37 +152,18 @@ void InitBackendInfo() D3D::UnloadDXGI(); } -void VideoBackend::ShowConfig(void* hParent) -{ - InitBackendInfo(); - Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_dx12"); -} - 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 +181,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(); } } |
