mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-24 07:06:33 +00:00
Fix some dll finding issues
Only skip dlls that are inside our streamline folder
This commit is contained in:
+4
-3
@@ -366,7 +366,8 @@ std::optional<std::filesystem::path> Util::FindFilePath(const std::filesystem::p
|
||||
const std::filesystem::path& fileName)
|
||||
{
|
||||
std::filesystem::path optiPath(Config::Instance()->MainDllPath.value());
|
||||
auto normalizedOptiPath = optiPath.lexically_normal();
|
||||
optiPath /= L"streamline";
|
||||
auto normalizedStreamlinePath = optiPath.lexically_normal();
|
||||
|
||||
const bool isDlssgOutput = State::Instance().activeFgOutput == FGOutput::DLSSG ||
|
||||
State::Instance().activeFgOutput == FGOutput::DLSSGWithNvngx;
|
||||
@@ -386,7 +387,7 @@ std::optional<std::filesystem::path> Util::FindFilePath(const std::filesystem::p
|
||||
if (!entry.is_directory() && entry.path().filename() == fileName)
|
||||
{
|
||||
auto normalizedPath = entry.path().lexically_normal();
|
||||
if (isDlssgOutput || !IsSubpath(normalizedPath, normalizedOptiPath))
|
||||
if (isDlssgOutput || !IsSubpath(normalizedPath, normalizedStreamlinePath))
|
||||
{
|
||||
LOG_INFO(L"{} found at {}", fileName.wstring(), entry.path().parent_path().wstring());
|
||||
return entry.path();
|
||||
@@ -414,7 +415,7 @@ std::optional<std::filesystem::path> Util::FindFilePath(const std::filesystem::p
|
||||
if (!entry.is_directory() && entry.path().filename() == fileName)
|
||||
{
|
||||
auto normalizedPath = entry.path().lexically_normal();
|
||||
if (isDlssgOutput || !IsSubpath(normalizedPath, normalizedOptiPath))
|
||||
if (isDlssgOutput || !IsSubpath(normalizedPath, normalizedStreamlinePath))
|
||||
{
|
||||
LOG_INFO(L"{} found at {}", fileName.wstring(), entry.path().parent_path().wstring());
|
||||
return entry.path();
|
||||
|
||||
@@ -1819,7 +1819,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||
if (!State::Instance().NVNGX_DLSS_Path.has_value() && Config::Instance()->MainDllPath.has_value())
|
||||
{
|
||||
std::filesystem::path dllsFolder(Config::Instance()->MainDllPath.value());
|
||||
State::Instance().NVNGX_DLSS_Path = Util::FindFilePath(dllsFolder.remove_filename(), "nvngx_dlss.dll");
|
||||
State::Instance().NVNGX_DLSS_Path = Util::FindFilePath(dllsFolder, "nvngx_dlss.dll");
|
||||
}
|
||||
|
||||
if (State::Instance().NVNGX_DLSS_Path.has_value())
|
||||
|
||||
Reference in New Issue
Block a user