mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -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:
@ -76,6 +76,9 @@ void ShaderCache::Shutdown()
|
||||
m_async_shader_compiler->StopWorkerThreads();
|
||||
m_async_shader_compiler->RetrieveWorkItems();
|
||||
}
|
||||
|
||||
if (g_ActiveConfig.bShaderCache && m_pipeline_cache != VK_NULL_HANDLE)
|
||||
SavePipelineCache();
|
||||
}
|
||||
|
||||
static bool IsStripPrimitiveTopology(VkPrimitiveTopology topology)
|
||||
|
@ -16,9 +16,6 @@ public:
|
||||
|
||||
std::string GetName() const override { return "Vulkan"; }
|
||||
std::string GetDisplayName() const override { return "Vulkan (experimental)"; }
|
||||
void Video_Prepare() override;
|
||||
void Video_Cleanup() override;
|
||||
|
||||
void InitBackendInfo() override;
|
||||
|
||||
unsigned int PeekMessages() override { return 0; }
|
||||
|
@ -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