VideoCommon: Pass WindowSystemInfo to InitBackendInfo

This commit is contained in:
Pokechu22
2023-03-25 17:16:53 -07:00
parent 7845fb00ee
commit c63f0f37cd
21 changed files with 76 additions and 57 deletions

View File

@ -281,7 +281,7 @@ void VideoBackendBase::ActivateBackend(const std::string& name)
g_video_backend = iter->get();
}
void VideoBackendBase::PopulateBackendInfo()
void VideoBackendBase::PopulateBackendInfo(const WindowSystemInfo& wsi)
{
g_Config.Refresh();
// Reset backend_info so if the backend forgets to initialize something it doesn't end up using
@ -289,18 +289,18 @@ void VideoBackendBase::PopulateBackendInfo()
g_Config.backend_info = {};
ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
g_Config.backend_info.DisplayName = g_video_backend->GetDisplayName();
g_video_backend->InitBackendInfo();
g_video_backend->InitBackendInfo(wsi);
// We validate the config after initializing the backend info, as system-specific settings
// such as anti-aliasing, or the selected adapter may be invalid, and should be checked.
g_Config.VerifyValidity();
}
void VideoBackendBase::PopulateBackendInfoFromUI()
void VideoBackendBase::PopulateBackendInfoFromUI(const WindowSystemInfo& wsi)
{
// If the core is running, the backend info will have been populated already.
// If we did it here, the UI thread can race with the with the GPU thread.
if (!Core::IsRunning())
PopulateBackendInfo();
PopulateBackendInfo(wsi);
}
void VideoBackendBase::DoState(PointerWrap& p)