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:
@ -245,22 +245,16 @@ bool VideoBackend::Initialize(void* window_handle)
|
||||
if (g_ActiveConfig.CanPrecompileUberShaders())
|
||||
g_shader_cache->PrecompileUberShaders();
|
||||
|
||||
// Display the name so the user knows which device was actually created.
|
||||
INFO_LOG(VIDEO, "Vulkan Device: %s", g_vulkan_context->GetDeviceProperties().deviceName);
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is called after Initialize() from the Core
|
||||
// Run from the graphics thread
|
||||
void VideoBackend::Video_Prepare()
|
||||
{
|
||||
// Display the name so the user knows which device was actually created
|
||||
OSD::AddMessage(StringFromFormat("Using physical adapter %s",
|
||||
g_vulkan_context->GetDeviceProperties().deviceName)
|
||||
.c_str(),
|
||||
5000);
|
||||
}
|
||||
|
||||
void VideoBackend::Shutdown()
|
||||
{
|
||||
if (g_renderer)
|
||||
g_renderer->Shutdown();
|
||||
|
||||
if (g_command_buffer_mgr)
|
||||
g_command_buffer_mgr->WaitForGPUIdle();
|
||||
|
||||
@ -279,15 +273,4 @@ void VideoBackend::Shutdown()
|
||||
ShutdownShared();
|
||||
UnloadVulkanLibrary();
|
||||
}
|
||||
|
||||
void VideoBackend::Video_Cleanup()
|
||||
{
|
||||
g_command_buffer_mgr->WaitForGPUIdle();
|
||||
|
||||
// Save all cached pipelines out to disk for next time.
|
||||
if (g_ActiveConfig.bShaderCache)
|
||||
g_shader_cache->SavePipelineCache();
|
||||
|
||||
CleanupShared();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user