Verify graphics config validity after populating the backend info

... and refresh the config before populating the backend info, as the config (specifically iAdapter) needs to be set to correctly populate the backend info.

Before, the list of valid antialiasing modes was always determined from the first adapter on the list on startup, regardless of the adapter the user selected.
This commit is contained in:
Pokechu22 2022-05-16 16:59:23 -07:00
parent 3950bc4620
commit 3949698acf
2 changed files with 10 additions and 6 deletions

View file

@ -272,11 +272,12 @@ void VideoBackendBase::ActivateBackend(const std::string& name)
void VideoBackendBase::PopulateBackendInfo()
{
// We refresh 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.Refresh();
ActivateBackend(Config::Get(Config::MAIN_GFX_BACKEND));
g_video_backend->InitBackendInfo();
g_Config.Refresh();
// 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()

View file

@ -44,7 +44,12 @@ void VideoConfig::Refresh()
// invalid values. Instead, pause emulation first, which will flush the video thread,
// update the config and correct it, then resume emulation, after which the video
// thread will detect the config has changed and act accordingly.
Config::AddConfigChangedCallback([]() { Core::RunAsCPUThread([]() { g_Config.Refresh(); }); });
Config::AddConfigChangedCallback([]() {
Core::RunAsCPUThread([]() {
g_Config.Refresh();
g_Config.VerifyValidity();
});
});
s_has_registered_callback = true;
}
@ -140,8 +145,6 @@ void VideoConfig::Refresh()
bFastTextureSampling = Config::Get(Config::GFX_HACK_FAST_TEXTURE_SAMPLING);
bPerfQueriesEnable = Config::Get(Config::GFX_PERF_QUERIES_ENABLE);
VerifyValidity();
}
void VideoConfig::VerifyValidity()