mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
VideoBackends: Combine Initialize/Prepare and Cleanup/Shutdown methods
Also allows the work previously done in Prepare to return a failure status.
This commit is contained in:
@ -58,38 +58,32 @@ bool VideoBackend::Initialize(void* window_handle)
|
||||
InitializeShared();
|
||||
InitBackendInfo();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is called after Initialize() from the Core
|
||||
// Run from the graphics thread
|
||||
void VideoBackend::Video_Prepare()
|
||||
{
|
||||
g_renderer = std::make_unique<Renderer>();
|
||||
g_vertex_manager = std::make_unique<VertexManager>();
|
||||
g_perf_query = std::make_unique<PerfQuery>();
|
||||
g_framebuffer_manager = std::make_unique<FramebufferManagerBase>();
|
||||
g_texture_cache = std::make_unique<TextureCache>();
|
||||
|
||||
VertexShaderCache::s_instance = std::make_unique<VertexShaderCache>();
|
||||
GeometryShaderCache::s_instance = std::make_unique<GeometryShaderCache>();
|
||||
PixelShaderCache::s_instance = std::make_unique<PixelShaderCache>();
|
||||
return true;
|
||||
}
|
||||
|
||||
void VideoBackend::Shutdown()
|
||||
{
|
||||
ShutdownShared();
|
||||
}
|
||||
g_renderer->Shutdown();
|
||||
|
||||
void VideoBackend::Video_Cleanup()
|
||||
{
|
||||
CleanupShared();
|
||||
PixelShaderCache::s_instance.reset();
|
||||
VertexShaderCache::s_instance.reset();
|
||||
GeometryShaderCache::s_instance.reset();
|
||||
|
||||
g_texture_cache.reset();
|
||||
g_perf_query.reset();
|
||||
g_vertex_manager.reset();
|
||||
g_framebuffer_manager.reset();
|
||||
g_renderer.reset();
|
||||
|
||||
ShutdownShared();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user