Add an extra layer of library protection

Stopping unneeded AMD calls in NVIDIA mode, and NVIDIA calls in AMD mode.
This commit is contained in:
Terry MacDonald 2021-10-29 22:10:29 +13:00
parent 42760c82c3
commit cc125b6601
2 changed files with 15 additions and 4 deletions

View File

@ -477,9 +477,20 @@ namespace DisplayMagicianShared
WinLibrary winLibrary = WinLibrary.GetLibrary();
// For a library update to the latest version so that we pick up any new changes since the last update
if (VideoMode == VIDEO_MODE.NVIDIA && nvidiaLibrary.IsInstalled)
{
nvidiaLibrary.UpdateActiveConfig();
winLibrary.UpdateActiveConfig();
}
else if (VideoMode == VIDEO_MODE.AMD && amdLibrary.IsInstalled)
{
amdLibrary.UpdateActiveConfig();
winLibrary.UpdateActiveConfig();
}
else
{
winLibrary.UpdateActiveConfig();
}
// Grab the profile data from the current stored config (that we just updated)
_nvidiaDisplayConfig = nvidiaLibrary.ActiveDisplayConfig;

View File

@ -1445,7 +1445,7 @@ namespace DisplayMagicianShared.Windows
if (!displayIdentifiers.Contains(displayIdentifier))
{
displayIdentifiers.Add(displayIdentifier);
SharedLogger.logger.Debug($"ProfileRepository/GenerateProfileDisplayIdentifiers: DisplayIdentifier: {displayIdentifier}");
SharedLogger.logger.Debug($"WinLibrary/GetSomeDisplayIdentifiers: DisplayIdentifier: {displayIdentifier}");
}
}