mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-28 17:16:46 +00:00
added upscaler dll checks
This commit is contained in:
@@ -970,6 +970,43 @@ bool Config::SaveFakenvapiIni() {
|
||||
return fakenvapiIni.SaveFile(FN_iniPath.wstring().c_str()) >= 0;
|
||||
}
|
||||
|
||||
void Config::CheckUpscalerFiles()
|
||||
{
|
||||
nvngxExist = std::filesystem::exists(Util::ExePath().parent_path() / L"nvngx.dll");
|
||||
|
||||
if (!nvngxExist)
|
||||
{
|
||||
nvngxExist = GetModuleHandle(L"nvngx.dll") != nullptr;
|
||||
|
||||
if(nvngxExist)
|
||||
LOG_INFO("nvngx.dll found in memory");
|
||||
else
|
||||
LOG_WARN("nvngx.dll not found!");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INFO("nvngx.dll found in game folder");
|
||||
}
|
||||
|
||||
libxessExist = std::filesystem::exists(Util::ExePath().parent_path() / L"libxess.dll");
|
||||
|
||||
if (!libxessExist)
|
||||
{
|
||||
libxessExist = GetModuleHandle(L"libxess.dll") != nullptr;
|
||||
|
||||
if (libxessExist)
|
||||
LOG_INFO("libxess.dll found in memory");
|
||||
else
|
||||
LOG_WARN("libxess.dll not found!");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_INFO("libxess.dll found in game folder");
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<std::string> Config::readString(std::string section, std::string key, bool lowercase)
|
||||
{
|
||||
std::string value = ini.GetValue(section.c_str(), key.c_str(), "auto");
|
||||
|
||||
@@ -276,6 +276,9 @@ public:
|
||||
|
||||
bool IsShuttingDown = false;
|
||||
|
||||
bool nvngxExist = false;
|
||||
bool libxessExist = false;
|
||||
|
||||
IFeature* CurrentFeature = nullptr;
|
||||
|
||||
bool Reload(std::filesystem::path iniPath);
|
||||
@@ -285,6 +288,8 @@ public:
|
||||
bool ReloadFakenvapi();
|
||||
bool SaveFakenvapiIni();
|
||||
|
||||
void CheckUpscalerFiles();
|
||||
|
||||
static Config* Instance();
|
||||
|
||||
private:
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)external\FidelityFX-SDK\ffx-api\include\ffx_api;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;$(SolutionDir)external\freetype;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(ProjectDir)fsr2\lib;$(ProjectDir)fsr2_212\lib;$(ProjectDir)fsr31\lib;$(ProjectDir)vulkan;$(ProjectDir)d3dx;$(ProjectDir)detours;$(SolutionDir)external\xess\lib;$(SolutionDir)external\freetype;$(LibraryPath)</LibraryPath>
|
||||
<TargetName>dxgi</TargetName>
|
||||
<OutDir>E:\Games\Deep Rock Galactic\FSD\Binaries\Win64\</OutDir>
|
||||
<OutDir>D:\Folders\Games\Deep Rock Galactic\FSD\Binaries\Win64\</OutDir>
|
||||
<IntDir>.\x64\Debug</IntDir>
|
||||
<TargetExt>.dll</TargetExt>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -90,9 +90,11 @@ inline std::vector<std::wstring> dxgiNamesW = { L"dxgi.dll", L"dxgi", };
|
||||
inline std::vector<std::string> vkNames = { "vulkan-1.dll", "vulkan-1", };
|
||||
inline std::vector<std::wstring> vkNamesW = { L"vulkan-1.dll", L"vulkan-1", };
|
||||
inline std::vector<std::string> overlayNames = { "eosovh-win32-shipping.dll", "eosovh-win32-shipping", "eosovh-win64-shipping.dll", "eosovh-win64-shipping",
|
||||
"gameoverlayrenderer64", "gameoverlayrenderer64.dll", "gameoverlayrenderer", "gameoverlayrenderer.dll" };
|
||||
"gameoverlayrenderer64", "gameoverlayrenderer64.dll", "gameoverlayrenderer", "gameoverlayrenderer.dll",
|
||||
"socialclubd3d12renderer", "socialclubd3d12renderer.dll" };
|
||||
inline std::vector<std::wstring> overlayNamesW = { L"eosovh-win32-shipping.dll", L"eosovh-win32-shipping", L"eosovh-win64-shipping.dll", L"eosovh-win64-shipping",
|
||||
L"gameoverlayrenderer64", L"gameoverlayrenderer64.dll", L"gameoverlayrenderer", L"gameoverlayrenderer.dll" };
|
||||
L"gameoverlayrenderer64", L"gameoverlayrenderer64.dll", L"gameoverlayrenderer", L"gameoverlayrenderer.dll",
|
||||
L"socialclubd3d12renderer", L"socialclubd3d12renderer.dll" };
|
||||
|
||||
static int loadCount = 0;
|
||||
static bool dontCount = false;
|
||||
@@ -1892,6 +1894,7 @@ static void CheckWorkingMode()
|
||||
{
|
||||
Config::Instance()->WorkingAsNvngx = isNvngxMode && !isWorkingWithEnabler;
|
||||
Config::Instance()->OverlayMenu = (!isNvngxMode || isWorkingWithEnabler) && Config::Instance()->OverlayMenu.value_or(true);
|
||||
Config::Instance()->CheckUpscalerFiles();
|
||||
|
||||
if (!isNvngxMode)
|
||||
{
|
||||
@@ -1944,7 +1947,6 @@ static void CheckWorkingMode()
|
||||
if ((!Config::Instance()->FGUseFGSwapChain.value_or(true) || !Config::Instance()->OverlayMenu.value_or(true)) &&
|
||||
skHandle == nullptr && Config::Instance()->LoadSpecialK.value_or(false))
|
||||
{
|
||||
//std::this_thread::sleep_for(std::chrono::milliseconds(250));
|
||||
auto skFile = Util::DllPath().parent_path() / L"SpecialK64.dll";
|
||||
SetEnvironmentVariableW(L"RESHADE_DISABLE_GRAPHICS_HOOK", L"1");
|
||||
skHandle = LoadLibrary(skFile.c_str());
|
||||
|
||||
@@ -342,10 +342,9 @@ LRESULT ImGuiCommon::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
_isVisible = !_isVisible;
|
||||
|
||||
if (_isVisible)
|
||||
{
|
||||
Config::Instance()->ReloadFakenvapi();
|
||||
|
||||
if (_isVisible)
|
||||
{
|
||||
if (pfn_ClipCursor_hooked)
|
||||
{
|
||||
_ssRatio = 0;
|
||||
@@ -835,9 +834,34 @@ void ImGuiCommon::RenderMenu()
|
||||
ImGui::Spacing();
|
||||
ImGui::PushFont(_scaledOptiFont);
|
||||
ImGui::SetWindowFontScale(Config::Instance()->MenuScale.value() * 3);
|
||||
ImGui::Text("Please select DLSS or XeSS as upscaler\nfrom game options and enter the game\nto enable upscaler settings.");
|
||||
ImGui::PopFont();
|
||||
ImGui::SetWindowFontScale(Config::Instance()->MenuScale.value());
|
||||
|
||||
if (Config::Instance()->nvngxExist || Config::Instance()->libxessExist)
|
||||
{
|
||||
ImGui::Spacing();
|
||||
ImGui::Text("Please select %s%s%s as upscaler\nfrom game options and enter the game\nto enable upscaler settings.\n",
|
||||
Config::Instance()->nvngxExist ? "DLSS" : "",
|
||||
Config::Instance()->nvngxExist && Config::Instance()->libxessExist ? " or " : "",
|
||||
Config::Instance()->libxessExist ? "XeSS" : "");
|
||||
|
||||
|
||||
ImGui::PopFont();
|
||||
ImGui::SetWindowFontScale(Config::Instance()->MenuScale.value());
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Text("nvngx.dll: %sExist", Config::Instance()->nvngxExist ? "" : "Not ");
|
||||
ImGui::Text("libxess.dll: %sExist", Config::Instance()->libxessExist ? "" : "Not ");
|
||||
ImGui::Spacing();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Spacing();
|
||||
ImGui::Text("Can't find nvngx.dll and libxess.dll\nUpscaling support will NOT work.");
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::PopFont();
|
||||
ImGui::SetWindowFontScale(Config::Instance()->MenuScale.value());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ImGui::BeginTable("main", 2, ImGuiTableFlags_SizingStretchSame))
|
||||
@@ -2447,6 +2471,7 @@ void ImGuiCommon::RenderMenu()
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::PopFont();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define VER_MAJOR_VERSION 0
|
||||
#define VER_MINOR_VERSION 7
|
||||
#define VER_HOTFIX_VERSION 0
|
||||
#define VER_BUILD_NUMBER 75
|
||||
#define VER_BUILD_NUMBER 76
|
||||
|
||||
#define VER_PRE_RELEASE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user