mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-24 23:26:50 +00:00
Improved auto FSR3.X/4 selection
This commit is contained in:
@@ -10,6 +10,18 @@
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include <mutex>
|
||||
|
||||
typedef enum WindowsVersion
|
||||
{
|
||||
Unknown = 0,
|
||||
WindowsXP,
|
||||
WindowsVista,
|
||||
Windows7,
|
||||
Windows8,
|
||||
Windows8_1,
|
||||
Windows10,
|
||||
Windows11,
|
||||
} WindowsVersion;
|
||||
|
||||
typedef enum API
|
||||
{
|
||||
NotSelected = 0,
|
||||
@@ -89,6 +101,7 @@ class State
|
||||
std::string GameVersion;
|
||||
GameEngineType GameEngine = GameEngineType::Other;
|
||||
ankerl::unordered_dense::map<void*, std::string> DeviceAdapterNames;
|
||||
WindowsVersion WindowsVer = WindowsVersion::Unknown;
|
||||
|
||||
bool NvngxDx11Inited = false;
|
||||
bool NvngxDx12Inited = false;
|
||||
|
||||
@@ -97,19 +97,46 @@ std::string Util::GetWindowsName(const OSVERSIONINFOW& os)
|
||||
DWORD build = os.dwBuildNumber;
|
||||
|
||||
if (major == 10 && build >= 22000)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::Windows11;
|
||||
return "Windows 11";
|
||||
}
|
||||
|
||||
if (major == 10)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::Windows10;
|
||||
return "Windows 10";
|
||||
}
|
||||
|
||||
if (major == 6 && minor == 3)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::Windows8_1;
|
||||
return "Windows 8.1";
|
||||
}
|
||||
|
||||
if (major == 6 && minor == 2)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::Windows8;
|
||||
return "Windows 8";
|
||||
}
|
||||
|
||||
if (major == 6 && minor == 1)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::Windows7;
|
||||
return "Windows 7";
|
||||
}
|
||||
|
||||
if (major == 6 && minor == 0)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::WindowsVista;
|
||||
return "Windows Vista";
|
||||
}
|
||||
|
||||
if (major == 5 && minor == 1)
|
||||
{
|
||||
State::Instance().WindowsVer = WindowsVersion::WindowsXP;
|
||||
return "Windows XP";
|
||||
}
|
||||
|
||||
return "Unknown Windows Version";
|
||||
}
|
||||
|
||||
@@ -186,8 +186,23 @@ void CheckForGPU()
|
||||
|
||||
if (!Config::Instance()->Dx12Upscaler.has_value())
|
||||
{
|
||||
LOG_INFO("Setting Dx12Upscaler to fsr31 because RDNA4 GPU is detected");
|
||||
Config::Instance()->Dx12Upscaler.set_volatile_value("fsr31");
|
||||
if (State::Instance().WindowsVer == WindowsVersion::Windows11)
|
||||
{
|
||||
LOG_INFO("Setting Dx12Upscaler to fsr31 because RDNA4 GPU is detected");
|
||||
Config::Instance()->Dx12Upscaler.set_volatile_value("fsr31");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (KernelBaseProxy::GetModuleHandleW_()(L"D3D12Core.dll") != nullptr)
|
||||
{
|
||||
LOG_INFO("Setting Dx12Upscaler to fsr31 because RDNA4 GPU is detected");
|
||||
Config::Instance()->Dx12Upscaler.set_volatile_value("fsr31");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_WARN("RDNA4 GPU is detected but Agility SDK is not detected!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user