Skip to content

Commit

Permalink
fix custom nvngx_dlss
Browse files Browse the repository at this point in the history
fix dlss (remove nvngx_dlss  from upscaler lisy)
  • Loading branch information
cdozdil committed Oct 20, 2024
1 parent 80f2f6b commit d021bff
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OptiScaler/OptiScaler.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)fsr2\lib;$(ProjectDir)fsr2_212\lib;$(ProjectDir)fsr31\lib;$(ProjectDir)vulkan;$(ProjectDir)d3dx;$(ProjectDir)detours;$(SolutionDir)external\xess\lib;$(LibraryPath)</LibraryPath>
<TargetName>dxgi</TargetName>
<OutDir>D:\Folders\Games\SteamLibrary\steamapps\common\DEATH STRANDING DIRECTORS CUT\</OutDir>
<OutDir>D:\Folders\Games\Banishers Ghosts of New Eden\NWD\Binaries\Win64\</OutDir>
<IntDir>.\x64\Debug</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down
34 changes: 31 additions & 3 deletions OptiScaler/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ inline std::vector<std::string> upscalerNames =
{
"nvngx.dll",
"nvngx",
"nvngx_dlss.dll",
"nvngx_dlss",
"libxess.dll",
"libxess"
};

inline std::vector<std::string> nvngxDlss =
{
"nvngx_dlss.dll",
"nvngx_dlss",
};

inline std::vector<std::string> nvapiNames =
{
"nvapi64.dll",
Expand All @@ -70,8 +74,14 @@ inline std::vector<std::wstring> upscalerNamesW =
{
L"nvngx.dll",
L"nvngx",
L"libxess.dll",
L"libxess"
};

inline std::vector<std::wstring> nvngxDlssW =
{
L"nvngx_dlss.dll",
L"nvngx_dlss"
L"nvngx_dlss",
};

inline std::vector<std::wstring> nvapiNamesW =
Expand Down Expand Up @@ -160,6 +170,15 @@ inline static HMODULE LoadLibraryCheck(std::string lcaseLibName)
return nvapi;
}

// nvngx_dlss
if (Config::Instance()->DLSSEnabled.value_or(true) && Config::Instance()->DLSSLibrary.has_value() && CheckDllName(&lcaseLibName, &nvngxDlss))
{
auto nvngxDlss = LoadNvgxDlss(string_to_wstring(lcaseLibName));

if (nvngxDlss != nullptr)
return nvngxDlss;
}

if (!isNvngxMode && CheckDllName(&lcaseLibName, &dllNames))
{
LOG_INFO("{0} call returning this dll!", lcaseLibName);
Expand Down Expand Up @@ -200,6 +219,15 @@ inline static HMODULE LoadLibraryCheckW(std::wstring lcaseLibName)
}
}

// nvngx_dlss
if (Config::Instance()->DLSSEnabled.value_or(true) && Config::Instance()->DLSSLibrary.has_value() && CheckDllNameW(&lcaseLibName, &nvngxDlssW))
{
auto nvngxDlss = LoadNvgxDlss(lcaseLibName);

if (nvngxDlss != nullptr)
return nvngxDlss;
}

// NvApi64.dll
if (!isWorkingWithEnabler && Config::Instance()->OverrideNvapiDll.value_or(false) && CheckDllNameW(&lcaseLibName, &nvapiNamesW))
{
Expand Down

0 comments on commit d021bff

Please sign in to comment.